我目前在自定义单元格中嵌入了youtube视频的tableview.
我这样做是因为从我的研究中看来,这似乎是允许视频加载而不离开我的应用程序的唯一方法.
问题是这样的:
缩略图需要一段时间才能加载.
当我向下滚动视频列表时,它不断加载thunbnails.
如果我向上滚动...它会再次尝试加载视频缩略图.
有没有人对更好的方法有什么建议,或者让表格单元格保留数据而不是替换它的方法?
我的代码看起来像这样:
CustomVideoCell *cell = (CustomVideoCell *)[tableView dequeueReusableCellWithIdentifier:@"CustomVideoCell"];
if (cell == nil) {
UIViewController *temporaryController = [[UIViewController alloc] initWithNibName:@"CustomVideoCell" bundle:nil];
cell = (CustomVideoCell *)temporaryController.view;
[temporaryController release];
GDataEntryBase *entry = [[self.feed entries] objectAtIndex:indexPath.row];
NSString *title = [[entry title] stringValue];
NSString *videoID = [[(GDataEntryYouTubeVideo *)entry mediaGroup] videoID];
NSString *htmlString =
[
[NSString alloc]
initWithFormat:@"<html><head><meta name = \"viewport\" content = \"initial-scale = 2.0, user-scalable = no, width = 110\"/></head><body style=\"background:#000;margin-top:0px;margin-left:0px\"><div><object width=\"110\" height=\"90\"><param name=\"movie\" value=\"http://www.youtube.com/v/%@&f=gdata_videos&c=ytapi-my-clientID&d=nGF83uyVrg8eD4rfEkk22mDOl3qUImVMV6ramM\"></param><param name=\"wmode\" value=\"transparent\"></param><embed src=\"http://www.youtube.com/v/%@&f=gdata_videos&c=ytapi-my-clientID&d=nGF83uyVrg8eD4rfEkk22mDOl3qUImVMV6ramM\" …Run Code Online (Sandbox Code Playgroud) 我正在使用以下代码在设备上构建电子邮件地址列表以显示在ListActivity.目前我可以检索确定的电子邮件地址,但它们的形式出现了:null (email@address.com)而name (email@address.com)不是理想的.我正在使用的代码也应该检索名称:
Cursor c = getContentResolver().query(Email.CONTENT_URI,
new String[]{Email.CONTACT_ID, Email.DISPLAY_NAME, Email.DATA},
null, null, null);
addresses = new String[c.getCount()];
try{
c.moveToFirst();
for(int i = 0;i<c.getCount();i++){
addresses[i] = c.getString(1) + " (" + c.getString(2) + ")";
c.moveToNext();
}
} finally {
c.close();
}
Run Code Online (Sandbox Code Playgroud)
有谁知道我做错了什么?
可能是一个简单的问题,但我在这里不知所措......
在github中,可以为每个存储库添加部署密钥,该部署密钥仅提供对该单个存储库的访问.
但是对于一个客户端,我在同一台服务器上使用git管理了两个项目(项目A和项目B).如果我使用项目A的公钥,github告诉我,我不能将它用作项目B的部署密钥,反之亦然.
如何创建另一个公钥并设置git以使用项目A的一个键和项目B的另一个键?
我需要用 内部HTML元素替换空格.例:
<table atrr="zxzx"><tr>
<td>adfa a adfadfaf></td><td><br /> dfa dfa</td>
</tr></table>
Run Code Online (Sandbox Code Playgroud)
应该成为
<table atrr="zxzx"><tr>
<td>adfa a adfadfaf></td><td><br /> dfa dfa</td>
</tr></table>
Run Code Online (Sandbox Code Playgroud)
我有mysql 5.1.44
mysql> show engines; +------------+---------+ | Engine | Support | +------------+---------+ | ndbcluster | NO | | MRG_MYISAM | YES | | BLACKHOLE | YES | | CSV | YES | | MEMORY | YES | | FEDERATED | NO | | ARCHIVE | YES | | InnoDB | YES | | MyISAM | DEFAULT |
现在,我需要在mysql中启用联邦引擎,我该怎么办?
好.这个qiestion的标题不容易解码,但让我解释一下.
为了建立一个共同点,我将提供一些详细信息,但这个问题适用于所有可能的上下文,语言和平台.
平台:.NET Framework 4.0系统:Windows(显然)语言:F#
我需要运行一个程序并评估执行某些指令所花费的时间.考虑有一个主要功能,你在那里放置一个时间计数器:
open System.Diagnostics
let main args =
let watch = new Stopwatch ()
watch.Start ()
(* Calling functions and executing main body... *)
watch.Stop ()
(* Printing out the evaluated time *)
Run Code Online (Sandbox Code Playgroud)
好!我有时间,我很开心.
现在我想衡量这个时间,但是从外面评估它.因此,请考虑运行该文件但同时计算时间的PowerShell脚本:
$MyProcess = New-Object "System.Diagnostics.Process";
$Watch = New-Object "System.Diagnostics.Stopwatch";
$MyProcess.StartInfo.FileName = "Myexec";
$MyProcess.StartInfo.Arguments = "args";
$MyProcess.StartInfo.CreateNoWindow = $true;
$MyProcess.StartInfo.UseShellExecute = $false;
$StartingTimer = $Watch.Start(); # Starts the timer
$StartingProcess = $MyProcess.Start();
$WaitingForExit = $MyProcess.WaitForExit();
$StoppingTimer = $Watch.Stop(); # Stops the timer
# …Run Code Online (Sandbox Code Playgroud) 为什么以下代码段不适用于CUDA(3.2和4.0)?
#define NUM_BLOCKS 16
// lots of code.
dim3 dimBlock(NUM_BLOCKS, NUM_BLOCKS);
Run Code Online (Sandbox Code Playgroud)
但是这个,
dim3 dimBlock(16, 16);
Run Code Online (Sandbox Code Playgroud)
呢?
我一直在error : expected a ")"和error : expected an expression.我错过了什么?
我有一个x86汇编程序,我正在使用gdb进行调试.有没有办法在gdb中打印进位标志的状态,比如"print $ cf"?
我有today = new Date();对象.我需要获得本周的第一天和最后一天.星期日和星期一我需要两种变体作为一周的开始和结束日.我现在对代码有点困惑.你可以帮帮我吗?
我创造了这样的功能
CREATE OR REPLACE FUNCTION tax
(p_sal IN NUMBER(4))
RETURN NUMBER
AS
v_tax NUMBER(4);
BEGIN
v_tax:= CASE
WHEN p_sal> 4000 THEN
p_sal*0.33
WHEN p_sal >2500 THEN
p_sal*0.25
WHEN p_sal >1500 THEN
p_sal*0.20
ELSE 0
END;
RETURN v_tax;
END;
/
Run Code Online (Sandbox Code Playgroud)
当我在插入stmt中使用此税功能时
INSERT INTO employees(eno, ename, job, join_date, sal, comm)
VALUES (7784,'allen','salesman',sysdate, 5000, tax(5000));
Run Code Online (Sandbox Code Playgroud)
它显示错误
ERROR: ORA-O6575: package or function tax is in invalid state.
Run Code Online (Sandbox Code Playgroud)
任何人都可以建议我如何使这个功能处于有效状态?提前致谢.
.net ×1
android ×1
assembly ×1
c++ ×1
carryflag ×1
cuda ×1
date ×1
function ×1
gdb ×1
git ×1
github ×1
html ×1
ios ×1
iphone ×1
javascript ×1
mysql ×1
objective-c ×1
oracle10g ×1
performance ×1
php ×1
powershell ×1
preg-replace ×1
public-key ×1
spaces ×1
ssh ×1
time ×1
uitableview ×1
youtube ×1