问题列表 - 第48303页

Google Analytics网页内分析如何运作?

Google Analytics(分析)具有"页内分析"视图,可直接在您自己的网站上显示点击率和其他信息.我正在寻找类似的东西来记录所有点击.

问题是我不确定Google如何实施他们的页内分析视图 - 他们似乎使用了一两个iframe,并将自己的HTML和JavaScript注入其他页面.

怎么会去做这样的事情 - iframes是最好的方式吗?如果domainX试图操纵domainY的呈现,你会如何避免Javascript的同源安全策略?

javascript iframe analytics

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

如何测试移动设备的网站

我可以使用什么来测试我使用HTML/CSS开发的网站,看看它在iPhone/iPad/Android等移动设备中的外观?Windows上的仿真器/模拟器?我可以安装Android SDK并使用它的模拟器吗?对于Apple的设备,我需要为SDK支付费用吗?我可以用来模仿的任何东西,我只是需要它来进行网站测试而不是应用程序.像www.testiphone.com或iphonetester.com这样的网站似乎不准确

html css mobile-website browser-testing

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

在Linux上创建原子文件?

如果文件不存在,我需要创建一个文件,试图创建此文件的另一个进程将失败.我甚至需要在创建过程完成向其写入实际数据之前将文件视为"已创建".

我读到了O_EXCL标志open(),所以似乎解决方案存在,但我有几个问题:

  1. 你有这种技术的经验吗?有多好?(我想我不能拥有DB级别的原子性,但是足够好就是......好吧,够了)
  2. 我应该立即关闭文件,open()以便将其视为已创建,然后重新打开以进行写入?
  3. 有什么细微之处需要注意吗?

c++ linux filesystems createfile atomicity

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

NSFileManager:隐藏文件夹?

我用下面的文件目录创建文件夹,我的问题是,如何隐藏这个文件夹,这样当我允许itune共享这个文件夹时不会出现给用户

/*创建新目录*/NSFileManager*filemgr; NSArray*dirPaths; NSString*docsDir; NSString*newDir;

filemgr =[NSFileManager defaultManager];

dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, 
                                               NSUserDomainMask, YES);

docsDir = [dirPaths objectAtIndex:0];

newDir = [docsDir stringByAppendingPathComponent:@"Patients"];

NSLog(newDir);

if(! [self SearchForDirectory:newDir] )
{
    NSLog(@"directory Not Exists");

    if ([filemgr createDirectoryAtPath:newDir withIntermediateDirectories:YES attributes:nil error: NULL] == NO)
    {
        NSLog(@"Failed to create directory");
    }
}
else{
    NSLog(@"directory Exists");

}
[filemgr release];
Run Code Online (Sandbox Code Playgroud)

iphone xcode objective-c

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

用JS/jQuery移动div的最流畅的方法

我需要从屏幕的右侧向左侧移动一个div,但是使用经典的JS和jQuery会让它变得生涩:

我的divs:

<div class="lisp" id="lisp0" style="top:100px;">)</div>
<div class="lisp2" id="lisp1" style="top:300px;">)</div>
Run Code Online (Sandbox Code Playgroud)

经典的javascript方法:

function move()
{
  pos = parseInt($("#lisp1").css("right"));
  $("#lisp1").css("right", pos+10+"px");
}
var interval = setInterval("move()",10);
Run Code Online (Sandbox Code Playgroud)

jQuery方法:

$("#lisp0").animate({"left": "-=2200px"}, 10000);
Run Code Online (Sandbox Code Playgroud)

我做了一个网页,告诉你它是多么生涩.第一步是jQuery(最流畅的),第二步是经典的JS.有几个div(和经典的JS),它开始真的很烦人. 我试图修改jQuery.fx.interval,但它并没有真正提高性能.

所以我的问题是:让这些div顺利移动的最佳方法是什么?

html javascript jquery move jquery-animate

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

保存变量Prolog

是否可以在Prolog中保存变量?

我想在程序运行时保存并编辑列表,但无论如何我都找不到在编辑之间保存列表.

variables prolog save

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

jqgrid rtl水平滚动条问题

当我调整网格大小,并出现水平滚动条时,我看到标题中有一个额外的空格,但我仍然在其他网格列上看到它.我想在最左边的列上看到这个滚动条.

这是我的代码:

$(function()
    {               
        $("#gridTable").jqGrid(
        {
            editurl: "clientArray",
            direction:"rtl",
            datatype: "local",
            colNames:['Code1','Code2', 'Code3', 'Code4','Code5','Code6','Code7','Code8','Code9'],
            colModel:[
                                        {name:'code1',index:'code1', width:60, sorttype:"int" , editable:true, edittype:'text'},
                                        {name:'code2',index:'code2', width:150, sorttype:"date" , editable:true, edittype:'text'},
                                        {name:'code3',index:'code3', width:150 , editable:true, edittype:'text'},
                                        {name:'code4',index:'code4', width:80,  sorttype:"float" , editable:true, edittype:'text'},
                                        {name:'code5',index:'code5', width:80, sorttype:"float" , editable:true, edittype:'text'},
                                        {name:'code6',index:'code6', width:80, sorttype:"float" , editable:true, edittype:'text'},
                                        {name:'code7',index:'code7', width:80, sortable:false , editable:true, edittype:'text'},
                                        {name:'code8',index:'code8', width:80, sorttype:"float" , editable:true, edittype:'text'},
                                        {name:'code9',index:'code9',  sorttype:"float" , editable:true, edittype:'text'},
                                  ],                
            height: '120px' ,
             scrolling: true,
            autowidth: true,
            shrinkToFit: false                
          });

          $("#gridTable").closest(".ui-jqgrid-bdiv").css({ 'overflow-y' …
Run Code Online (Sandbox Code Playgroud)

jqgrid

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

使用托管包框架实现语言服务

我已经按照步骤(http://msdn.microsoft.com/en-us/library/bb166360.aspx)中列出的步骤来实现和注册LanguageService,但我根本无法使用它.

我的包正确加载,我可以添加功能菜单项和选项页,但我无法打开注册到我的服务的文件.当我附加一个调试器时,我可以看到我的VSPackage被构造,加载,并且它的FDoIdle方法被调用了两次.在那之后,实验性的Visual Studio会话进入杂草并且似乎陷入无限循环.如果我尝试将.txt文件保存为我的文件类型,则文件会正确保存,但不会在Visual Studio中加载,我会收到Object null异常.

我可以看到我在这个问题中提到的问题:Visual Studio 2010着色剂,智能感知和其他.从哪儿开始!

解决方案似乎是不使用Managed Package Framework而是使用Manage Extensibility Framework.这很好,但是我真的很想知道我的MPF语言服务实现有什么问题.

有没有人使用MPF成功创建了LanguageService?任何人都可以指导我一个工作示例或演练吗?

问题解决了!:

我做了一些进一步的调试,并注意到实验性的Visual Studio实例被卡住后重复调用:

Microsoft.VisualStudio.Editor.Implementation.VsFontsAndColorsInformation.TryGetIndexForNativeItem(String name,IVsColorTable colorTable,Int32&colorTableIndex)

在预感中,我在ProvideLanguageServiceAttribute中将RequestStockColors参数指定为true,现在我可以打开我的文件类型.我的简单扫描仪甚至还有工作语法着色!

c# mef mpf languageservice walkthrough

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

Builder模式的真实示例

我想看看Builder模式在现实世界的应用程序/ API中是如何使用的.我发现的例子包括比萨饼,蛋糕,汽车等等(加上GoF书中的解析器示例).

你能否告诉我这个模式在实际应用程序/ API中的一些用法,最好是来自C++,.NET或PHP的世界(因为那些是我熟悉的语言).

谢谢.

design-patterns builder

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

如何覆盖 maven-compiler-plugin 的配置。(构建目录,我想通过使用配置文件进行更改)

我想通过使用 maven 的配置文件来忽略特定目录中的一些构建错误。我试着像下面那样做,但没有用。任何帮助将不胜感激?

============================================
[executed command]

mvn -P test clean compile

============================================
[part of pom.xml]

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.5</source>
                <target>1.5</target>
                <showWarnings>true</showWarnings>
            </configuration>
        </plugin>
    </plugins>
</build>
<profiles>
    <profile>
        <id>test</id>
        <build>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>1.5</source>
                        <target>1.5</target>
                    </configuration>
                    <executions>
                        <execution>
                            <id>default-compile</id>
                            <configuration>
                                <excludes>
                                    <exclude>**/nocompile/*</exclude>
                                </excludes>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>

============================================
[a class happened a build error]

package com.sample.web.nocompile;

public class NoCompileSample {

    // An error do happen here 
    private String

}
Run Code Online (Sandbox Code Playgroud)

java maven-2 maven-plugin maven

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