我希望通过API调用获得朋友的朋友,当我尝试这样做时,我得到以下异常,
{
"error": {
"type": "OAuthException",
"message": "(#604) Can't lookup all friends of .... Can only lookup for the logged in user (...), or friends of the logged in user with the appropriate permission"
}
}
Run Code Online (Sandbox Code Playgroud)
我尝试访问的网址是,
https://graph.facebook.com/friend_id/friends?access_token=access_token
我获得扩展权限,如下所示,
<fb:login-button perms="user_likes,friends_likes"></fb:login-button>
Run Code Online (Sandbox Code Playgroud)
请问任何人请告诉我这里出了什么问题?或者这是否意味着我永远无法访问朋友的朋友?
我正在做一些图像处理代码,我从URL下载一些图像(作为BufferedImage)并将其传递给图像处理器.
我想避免多次将同一图像传递给图像处理器(因为图像处理操作成本很高).图像的URL端点(如果它们是相同的图像)可能会有所不同,因此我可以通过URL来防止这种情况.所以我打算做一个校验和或散列来确定代码是否再次遇到相同的图像.
对于md5,我尝试了Fast MD5,它为图像生成了一个20K +字符长度的十六进制校验和值(一些样本).显然,在数据库存储方面存储这个20K +字符哈希是一个问题.因此我尝试了CRC32(来自java.util.zip.CRC32).它确实产生了比哈希小得多的长度校验和.
我确实理解校验和和哈希用于不同的目的.出于上述目的,我可以使用CRC32吗?它会解决目的还是我必须尝试比这两个更多的东西?
谢谢,阿比
有没有办法ServletContext在EL中设置属性,以便最终成为JavaScript变量?
我把它设为
context.setAttribute("testing.port", "9000");
Run Code Online (Sandbox Code Playgroud)
我尝试检索它
alert("port" +'${testing.port}');
Run Code Online (Sandbox Code Playgroud)
我只是一片空白.
我想在项目的一个简单例子中使用quartz.我得到以下异常,我不确定它是什么意思...但是我在我的POM文件中将我的slf4j更新为1.6.1,即使这样仍然出现,
SLF4J: slf4j-api 1.6.x (or later) is incompatible with this binding.
SLF4J: Your binding is version 1.5.5 or earlier.
SLF4J: Upgrade your binding to version 1.6.x. or 2.0.x
Exception in thread "main" java.lang.NoSuchMethodError: org.slf4j.impl.StaticLoggerBinder.getSingleton()Lorg/slf4j/impl/StaticLoggerBinder;
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:121)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:268)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:241)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:131)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:395)
at org.quartz.impl.StdSchedulerFactory.<init>(StdSchedulerFactory.java:249)
............
Run Code Online (Sandbox Code Playgroud)
任何有关这方面的帮助将受到高度赞赏.谢谢.
我正在寻找一个eclipse插件或一个开源工具来反向设计序列图.我尝试使用Alto UML,但它只是给出了所选类的序列图.我想有一个整个调用堆栈的序列图,包括方法,输入参数和输出结果.
能告诉我一些关于此事的建议吗?谢谢!
我正在寻找Java或C ++中的API来读取MRZ并解码旅行证件(护照)中的MRZ代码。
有关MRZ的更多信息,请访问http://www.highprogrammer.com/alan/numbers/mrp.html。以前有人使用API做到过吗?
我试图使用HibernateInterceptor作为建议,我试图自动装配它.
代码如下,
@Aspect
public class InterceptorAdvice{
private HibernateInterceptor hibernateInterceptor;
@Autowired
public void setHibernateInterceptor(@Qualifier("hibernateInterceptor") HibernateInterceptor hibernateInterceptor) {
this.hibernateInterceptor = hibernateInterceptor;
}
@Around("execution(* *..*.dao..*.*(..))")
public Object interceptCall(ProceedingJoinPoint joinPoint) throws Exception {
Object obj = null;
try{
.......
}catch(Exception e){
e.printStackTrace();
}
return obj;
}
}
Run Code Online (Sandbox Code Playgroud)
以下是我的XML映射,
<bean id="hibernateInterceptor" class="org.springframework.orm.hibernate3.HibernateInterceptor" autowire="byName">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<!--To enable AspectJ AOP-->
<aop:aspectj-autoproxy/>
<!--Your advice-->
<bean class="com.web.aop.InterceptorAdvice"/>
<!--Looks for any annotated Spring bean in com.app.dao package-->
<context:component-scan base-package="com.web.dao"/>
<!--Enables @Autowired annotation-->
<context:annotation-config/>
Run Code Online (Sandbox Code Playgroud)
当我检查hibernateInterceptop时,我得到的只是NULL :( ...不确定为什么它无法自动装入hibernate拦截器
有任何想法吗?谢谢你的时间. …
我是一个有游戏框架的初学者.关于JPA和Play框架中的映射的问题,
我有一个学生表和一个由一对一关系约束的导师表.
学生表:
id, name, class, grade
Run Code Online (Sandbox Code Playgroud)
导师表:
id, name, department, student_id
Run Code Online (Sandbox Code Playgroud)
在上文中,导师可能有也可能没有绑定他/她的学生.我正在使用一对一的映射制作导师模型,
@OneToOne
@JoinColumn(name="fk_student_id", referencedColumnName="id")
private student Student;
Run Code Online (Sandbox Code Playgroud)
当我尝试运行它时,我得到了一个
发生JPA错误(无法构建EntityManagerFactory):属性映射列数错误:models.Mentor.student类型:models.Student.
我确信我已将所有学生字段映射如下,
@Id @GeneratedValue(strategy=GenerationType.AUTO)
private long id;
@Column(name="name")
private String name;
@Column(name="class")
private String cls;
@Column(name="grade")
private String grade;
Run Code Online (Sandbox Code Playgroud)
我在这里错过了什么?
谢谢你的时间.
问候,阿比
我必须使用不同的log4j.xml和属性文件,这些文件将在Dev和Production中使用.我正在使用maven进行建筑和包装.有没有办法让maven在POM中通过可配置的maven属性选择dev或prod,或者传递一个运行时变量?
谢谢,阿比
目前我有一个代码,它有一个java main方法,并且它的执行需要很少的命令行参数.我正在将这个作为一个石英工作,我想把这个论点传递给这个工作.
有没有办法可以做到?我对JobDataMap进行了一些分析,但我不确定是否可以将它用于此目的.
此外,这项工作将是一次性工作,需要暂停并继续用户的一些操作.我应该为石英这种情况扩展或使用什么样的工作?
非常感谢你的时间.
干杯,阿比