我想选择索引UITableView.我写了以下代码:
NSIndexPath *index = [NSIndexPath indexPathForRow:1 inSection:0];
[tableView scrollToRowAtIndexPath:index
atScrollPosition:UITableViewScrollPositionTop
animated:YES];
Run Code Online (Sandbox Code Playgroud)
这总是适用于第一项.我想要选择索引indexPathForRow.
请帮忙.谢谢.
我有一个简单的Google地图叠加层:http://pastebin.com/Rg8miMSh,我根据缩放级别添加/删除项目.删除/添加后,我在覆盖上填充填充并在地图视图上无效.一切正常,除了1个小问题:删除项目后,如果我点击其位置onTap仍然被触发,因为OverlayItem不再存在,我在com.google.android.maps.ItemizedOverlay中得到java.lang.ArrayIndexOutOfBoundsException . maskHelper(ItemizedOverlay.java:562)(完整堆栈跟踪 - http://pastebin.com/KThn4ZLE)
谁知道为什么会这样?最初我打电话给clear并再次添加所有项目,这似乎不会导致这个问题.然而,有许多项目这成为一个性能问题.仅添加/删除差异的速度要快得多,我想保留这种方法.谢谢!
好的,所以我需要构建这个应用程序,我将从www.flickr.com帐户读取图像并使用我的Python应用程序中的图像.我该怎么做?有任何想法吗?谢谢.
我需要通过使用注释作为切入点来接受一些方法及其属性,但是如何访问这些方法属性.我有以下代码,可以在方法运行之前成功运行代码,但我只是不知道如何访问这些attrbiutes.
package my.package;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
@Aspect
public class MyAspect {
@Pointcut(value="execution(public * *(..))")
public void anyPublicMethod() {
}
@Around("anyPublicMethod() && @annotation(myAnnotation )")
public Object myAspect(ProceedingJoinPoint pjp, MyAnnotation myAnnotation)
throws Throwable {
// how can I access method attributes here ?
System.out.println("hello aspect!");
return pjp.proceed();
}
}
Run Code Online (Sandbox Code Playgroud) 我想读取一个大的InputStream并将其作为String返回.这个InputStream很大.所以,通常它需要花费很多时间和大量内存才能被激发.以下代码是我迄今为止开发的代码.我需要转换此代码,因为它在较少的时间内消耗较少的内存.
你能给我任何想法吗?
BufferedReader br =
new BufferedReader(
new InputStreamReader(
connection.getInputStream(),
"UTF-8")
);
StringBuilder response = new StringBuilder(1000);
char[] buffer = new char[4096];
int n = 0;
while(n >= 0){
n = br.read(buffer, 0, buffer.length);
if(n > 0){
response.append(buffer, 0, n);
}
}
return response.toString();
Run Code Online (Sandbox Code Playgroud)
谢谢!
我在我的父Web应用程序配置文件中有以下内容
<configuration>
<configSections>
<sectionGroup name="testmodule">
<section name="testmodule" type="RewriteModule.RewriteModuleSectionHandler, RewriteModule"/>
</sectionGroup>
</configSections>
</configuration>
Run Code Online (Sandbox Code Playgroud)
我想防止子子文件夹继承此配置部分应放在哪里
<location path="." inheritInChildApplications="false">,因为配置部分应该是配置文件的第一个子元素
有什么区别:
$(function() {
//.....
});
Run Code Online (Sandbox Code Playgroud)
和
$(document).ready(function() {
//......
});
Run Code Online (Sandbox Code Playgroud)
在jQuery编码?
伪代码:
class SomeController {
def myAction() {
// controler is an property passed via ctor
controller.redirect(toWhereever)
}
}
// another variant
class AnotherController {
def myAction(controller) {
// controler is an method argument
controller.redirect(toWhereever)
}
}
Run Code Online (Sandbox Code Playgroud)
有什么建议?
编辑:因为问题有点干,你可以尝试用框架的一些经验来增加你的答案,你认为这种方法更好.
language-agnostic model-view-controller design-patterns web-applications
我有一个Java String对象.我只需从中提取数字.我举个例子:
"123-456-789" 我想要 "123456789"
是否有只提取数字的库函数?
谢谢你的回答.在我尝试这些之前,我需要知道是否必须安装任何额外的llibraries?
java ×3
android ×1
aop ×1
asp.net ×1
aspectj ×1
c# ×1
charts ×1
flickr ×1
google-maps ×1
ios ×1
iphone ×1
jquery ×1
legend ×1
nsindexpath ×1
objective-c ×1
overlay ×1
pie-chart ×1
python ×1
spring-aop ×1
string ×1
uitableview ×1
wpf ×1