问题列表 - 第38489页

在jQuery UI中将其分配给self

我目前正在编写一个jQuery UI插件,因此调查现有的jQuery UI源代码.在_create手风琴插件的方法中,this分配给self (链接到源),但是然后两者thisself在该方法中并排使用.那他们为什么选择分配self

javascript jquery-ui this variable-assignment

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

如何知道图像是从用户的网络缓存中提取还是如何获得准确的加载时间?

我正在使用一个JavaScript脚本,告诉我是否在用户的浏览器缓存中缓存了特定的图像URL.我正在使用它,因为我构建了一系列非缓存图像,这些图像将在完成更重要的过程后单独加载.此脚本专为Google Chrome编写,因此我不需要跨浏览器解决方案.

我当前的函数检查加载图像所花费的时间,如果它小于几毫秒(目前为25毫秒),我认为它是从缓存中提取的.

通过查看Chrome开发人员工具中的资源面板,可以轻松手动查看缓存图像和非缓存图像之间的区别.当悬停加载时间时,Chrome会通过打印如下所示的工具提示来判断文件是否已从缓存中拉出:xx ms Latency, xx ms Download (from cache).

我注意到在某些情况下,延迟时间很长(例如64ms,下载时间仅为2ms)并且使得我的检测功能无用,因为总加载时间超过了我的阈值.不可能增加阈值,因为小的且未缓存的图像也可以在相同的时间内加载.

既然你遇到了我的问题,这就是我的问题:

- 是否有可能以100%准确的方式检查(例如chrome的资源面板)该文件来自缓存?(我想如果该小组这样做,必须有一种方法,但我无法在互联网上找到它)

要么

- 有没有办法将两个延迟(即延迟与下载)分开才能检查真正的下载时间?计算开始加载图像和onload事件之间所花费的时间将返回总时间.


感谢您阅读我的问题,即使您没有精确的解决方案,也欢迎提出想法和想法!

(PS:我不是母语为英语的人,所以请不要因为犯错而责怪我!)

盖尔

javascript time caching image loading

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

当AllowTransparency ="True"时,wpf WindowsFormsHost不可见

有人在这里解决了这个问题http://social.msdn.microsoft.com/forums/en-US/wpf/thread/6f9dd3b5-af92-4076-9b4e-1a770dd52f70/

但那是在2006年.我目前正在使用.net framework 3.5.现在还有更好的解决方案吗?有人知道微软是否在4.0中为这个问题提供了直接的解决方案吗?

wpf windowsformshost

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

如何将存储过程迁移到测试db?

我在Rails 3.0.7中存储过程和测试数据库存在问题.跑步时

rake db:test:prepare

它从schema.rb迁移db表,而不是直接从迁移迁移.通过调用execute方法并传入诸如的SQL字符串,在迁移过程中创建过程CREATE FUNCTION foo() ... BEGIN ... END;.

经过研究,我发现你应该使用

config.active_record.schema_format =:sql

在里面application.rb.添加此行后,我执行了

rake db:structure:dump rake db:test:clone_structure

第一个应该将结构转储到development.sql文件中,第二个应该从该文件创建测试数据库.但是我的存储过程和函数仍未出现在测试数据库中.如果有人知道这个问题.帮助将不胜感激.

我也试过运行rake db:test:再次准备,但仍然没有结果.

MySQL 5.5,Rails 3.0.7,Ruby 1.8.7.

提前致谢!

mysql testing stored-procedures ruby-on-rails-3

15
推荐指数
2
解决办法
4632
查看次数

在Python中使用.net正则表达式

我有一些为Microsoft的.net正则表达式格式编写的正则表达式,我想在Linux机器上的python程序中使用它们.是否有兼容的库或覆盖它们的方法?如果我必须手工完成,你知道一个备忘单或指南吗?

.net python regex pcre

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

基本CLI库'mscorlib'与引用的F#核心库二进制不兼容

我已经建立了一个网站,它接受代码片段并编译它们并运行它们.但是,F#在服务器上被破坏了.每当我尝试编译F#代码时,我都会收到以下错误消息:

The referenced or default base CLI library 'mscorlib' is binary-incompatible with the referenced F# core library 'C:\Program Files (x86)\Microsoft F#\v4.0\FSharp.Core.dll'. Consider recompiling the library or making an explicit reference to a version of this library that matches the CLI version you are using.

Error opening binary file 'C:\Program Files (x86)\Microsoft F#\v4.0\FSharp.Core.dll': Exception of type 'Microsoft.FSharp.Compiler.ErrorLogger+ReportedError' was thrown.

To be clear, this is an error being returned by the compiler, not an error that occurs when the code is run. …

.net f# compiler-errors

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

How to exclude a character from a regex group?

I want to strip all non-alphanumeric characters EXCEPT the hyphen from a string (python). How can I change this regular expression to match any non-alphanumeric char except the hyphen?

re.compile('[\W_]')
Run Code Online (Sandbox Code Playgroud)

Thanks.

python regex

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

Image view not updating on NSThread

I'm trying to make a test app which measures the performance for threads. However, I'm trying to set an image to imageview on a thread and it's not updating. In fact, the methods setImage1 and setImage2 aren't even getting called. Any ideas? Look at the code for details

#import "UntitledAppDelegate.h"
#import <QuartzCore/QuartzCore.h>

@implementation UntitledAppDelegate

@synthesize window, imageView1, imageView2, label1, label2, label0;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{            
    [window makeKeyAndVisible];
    return YES;
}

-(IBAction) startSeparate:(id) sender
{
 imageView1.image = imageView2.image = …
Run Code Online (Sandbox Code Playgroud)

iphone cocoa objective-c nsthread ios

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

Cast function argument as a character string?

超级快速的问题......

如何获取某个特定函数(用户定义的)参数并将其转换为字符串?

如果是一个简单的例子,

foo <- function(x) { ... }
Run Code Online (Sandbox Code Playgroud)

我想简单地返回x的对象名称.所以,

foo(testing123)
Run Code Online (Sandbox Code Playgroud)

返回"testing123"(并且testing123可能只是一些随机数字向量)

如果之前已经问过这个问题,我会道歉 - 搜索,但找不到它!谢谢!!

r

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

可以从sql plus运行oracle包而不将其编译成数据库吗?

我有一个特定的oracle包文件(pkk with pks).我想从sqlplus执行包中的一个方法.我想这样做而不将包编译到oracle数据库中.

这可能吗 ?如果是这样的话?

sql oracle plsql sqlplus

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