小编Att*_*ers的帖子

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

是否已准备好ObjectDB生产?

在这个基准测试中,ObjectDB是最快的数据库:http: //www.jpab.org/All/All/All.html

但我看不到ObjectDB的任何其他基准测试结果.是否有人使用ObjectDB?生产准备好了吗?有什么经历?

java jpa object-oriented-database objectdb

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

如何在我的风格中获得自己定义的属性值

我想使用自定义(自己)属性为对话框创建3个不同的主题.我想通过将其添加到主题的样式来设置标题颜色: <item name="titleColor">#FF0000</item>

我的themes.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="MyTheme" parent="@android:style/Theme">
    <item name="android:alertDialogStyle">@style/dialog</item>
</style>
<style name="MyRedTheme" parent="MyTheme">
    <item name="titleColor">#FF0000</item>
</style>
<style name="MyGreenTheme" parent="MyTheme">
    <item name="titleColor">#00FF00</item>
</style>
<style name="MyBlueTheme" parent="MyTheme">
    <item name="titleColor">#0000FF</item>
</style>
Run Code Online (Sandbox Code Playgroud)

我在attrs.xml中定义了titleColor属性:

<?xml version="1.0" encoding="utf-8"?>
<resources>
 <declare-styleable name="MyCustomAttributes">
  <attr name="titleColor" format="color|reference" />
 </declare-styleable>
</resources>
Run Code Online (Sandbox Code Playgroud)

我为对话框应用了一个主题.如何将titleColor属性的值传递给"android:color"属性?

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
       xmlns:custom="http://schemas.android.com/apk/res/com.dicare"
   android:shape="rectangle">
       <solid android:color="I want to pass titleColor value here"/>
</shape>
Run Code Online (Sandbox Code Playgroud)

resources android themes coding-style

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

现在使用图谱API的facebook见解是什么?

我想使用图形API来获取没有Facebook JS SDK的页面和应用程序见解.我尝试了以下方法:

  • 我用用户A创建了一个应用程序
  • 我使用以下URL与用户B登录该应用程序(用户B是页面和应用程序的管理员)

https://m.facebook.com/dialog/oauth?client_id=[appID]&redirect_uri=[uri]&scope=read_insights,manage_pages&response_type=token

  • 使用上面的URL,登录没问题,我得到了访问令牌
  • 使用https://graph.facebook.com/me/accounts我获得了应用程序和页面列表
  • 最后,我尝试使用以下网址https://graph.facebook.com/ [page id]/insights&access_token = [login_response_access_token]查询数据分析值,但我得到以下空结果:

{"data":[],"paging":{"previous":"https://graph.facebook.com/ [page_id]/insights?format=json&since=1329064393&until=1329323593","next":"https: //graph.facebook.com/ [page_id]/insights?format=json&since=1329582793&until=1329841993"}}

我的步骤有什么问题?我尝试使用Graph API Explorer,但无法从以下网址获取数据分析值:

https://developers.facebook.com/tools/explorer

  1. 在网址上方打开
  2. 获取访问令牌(read_insights,manage_pages)
  3. https://graph.facebook.com/[page_id]/insights返回相同的空JSON

facebook-graph-api facebook-insights

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

在Android上哪个解决方案会更快?

在Android 2.1上哪种解决方案会更快?

1.

public void foo(String a, String b)
{
 String msg = a + ": " + b;
 print(msg);
}
Run Code Online (Sandbox Code Playgroud)

2.

public void foo(String a, String b)
{
 StringBuilder sb = new StringBuilder(a.length() + b.length() + 2);
 sb.append(a);
 sb.append(": ");
 sb.append(b);
 print(sb.toString());
}
Run Code Online (Sandbox Code Playgroud)

android是否在内部使用StringBuilder作为第一个解决方案?

java android

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

在浏览器中打开网址并强制重新加载页面

我使用以下代码在浏览器中打开一个URL:

Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(url));
startActivity(intent);
Run Code Online (Sandbox Code Playgroud)

但是如果网址后面的页面已经在浏览器中打开,则运行上面的代码不会刷新页面.我怎么能强制页面刷新?

browser android android-intent

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