小编com*_*eak的帖子

Google Chrome扩展程序 - 将焦点设置为omnibar

我正在开发一个Google Chrome扩展程序,需要将重点放在Omnibar上.我还没有在API参考中找到任何内容.有可能吗?

谢谢你的帮助!

javascript google-chrome-extension

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

如何使用Google Maps SDK for iOS绘制圆圈?

我真的很困惑这个问题.我想在我的iOS应用中在谷歌地图上绘制圆圈.在SDK帮助中仅提供多边形的示例.有人有同样的问题吗?

google-maps ios google-maps-sdk-ios

4
推荐指数
2
解决办法
5890
查看次数

我怎样才能找到这个Json对象的长度

我想找到这个JSON对象的长度,所以任何人告诉我如何获得JSON对象的长度...意味着我想知道这个json对象包含多少数据.

var ddData = [{ "01":"United States",
                "02":"United Kingdom",
                "03":"Aruba",
                "04":"United Kingdom",
                "05":"Aruba",
                "06":"Bahrain",
                "07":"United Kingdom",
                "08":"Algeria",
                "09":"Andorra",
                "10":"American Samoa",
                "11":"United States"
             }]
Run Code Online (Sandbox Code Playgroud)

javascript jquery json

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

umbraco - 如何按文档类型获取所有节点

如何按具体方式获取所有节点Document Type

例如,我想在所有节点后面使用代码Document Type: s3Article.我怎样才能做到这一点?


新信息:

    IEnumerable<Node> nodes = uQuery.GetNodesByType("s3Article").Where(x => x.NiceUrl.Contains("en"));

    lvArticles.DataSource = nodes;
    lvArticles.DataBind();
Run Code Online (Sandbox Code Playgroud)

这是我的代码.我不得不使用Where(x => x.NiceUrl.Contains("en")),因为我有2个语言版本 - 没有Where我收到所有带doctype的目录中的节点s3Article,但我想只从一个语言版本获得.

问题在这里:

<a href='<%# umbraco.library.NiceUrl(Tools.NumericTools.tryParseInt( Eval("id"))) %>'><%# Eval("title")%></a>
<%# Tools.TextTools.makeIMGHTML("../.."+ Eval("img").ToString(),"180") %>
<%# umbraco.library.StripHtml(Limit(Eval("Article"), 1000))%>
<%# Eval("author")%>
Run Code Online (Sandbox Code Playgroud)

System.Web.HttpException:DataBinding:'umbraco.presentation.nodeFactory.Node'不包含名为'title'的属性.

标题,img,文章,作者也会出现同样的问题.只有ID很好用.怎么解决?

umbraco

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

Google Analytics - 活动中的跟踪器对象

我正在从活动中创建Google Analytics跟踪器对象.问题是我在this.getApplication()上执行的强制转换操作中出错.请告诉我如何从Activity创建跟踪器对象.

public void sengToGoogleAnalytics() {
    Tracker t = ((AnalyticsSampleApp) this.getApplication()).getTracker(TrackerName.APP_TRACKER);
    t.setScreenName(getString(R.string.memoryhome));
    t.send(new HitBuilders.AppViewBuilder().build());
} 
Run Code Online (Sandbox Code Playgroud)

日志

06-11 11:49:59.510: E/AndroidRuntime(2917): FATAL EXCEPTION: main06-11 11:49:59.510: E/AndroidRuntime(2917): java.lang.RuntimeException: Unable to start activity ComponentInfo{kids.animals.fruits.objects.brain.puzzle.memory.game.free/kids.animals.fruits.objects.brain.puzzle.memory.game.free.MemoryHome}: java.lang.ClassCastException: android.app.Application cannot be cast to kids.animals.fruits.objects.brain.puzzle.memory.game.free.AnalyticsSampleApp06-11 11:49:59.510: E/AndroidRuntime(2917): 
06-11 11:49:59.510: E/AndroidRuntime(2917): java.lang.RuntimeException: Unable to start activity ComponentInfo{kids.animals.fruits.objects.brain.puzzle.memory.game.free/kids.animals.fruits.objects.brain.puzzle.memory.game.free.MemoryHome}: java.lang.ClassCastException: android.app.Application cannot be cast to kids.animals.fruits.objects.brain.puzzle.memory.game.free.AnalyticsSampleApp06-11 11:49:59.510: E/AndroidRuntime(2917): 06-11 11:49:59.510: E/AndroidRuntime(2917): 
06-11 11:49:59.510: E/AndroidRuntime(2917): 06-11 11:49:59.510: E/AndroidRuntime(2917): 06-11 11:49:59.510: E/AndroidRuntime(2917): 
06-11 11:49:59.510: E/AndroidRuntime(2917): 06-11 11:49:59.510: E/AndroidRuntime(2917): 06-11 11:49:59.510: E/AndroidRuntime(2917): 
06-11 11:49:59.510: …
Run Code Online (Sandbox Code Playgroud)

android google-analytics google-analytics-api

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

自定义对话框在android中顶部留有空白

我正在开发一个应用程序,我已实现自定义对话框以进行确认,我为该对话框创建了一个自定义布局,但它的顶部带有空白,有人可以帮我删除它吗? XML文件

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_gravity="center"
    android:gravity="center"
    android:background="@drawable/bg_et_selected"
    android:layout_width="300dp" android:layout_height="170dp">

   <RelativeLayout

       android:layout_width="300dp"
       android:layout_height="170dp">
       <TextView
           android:id="@+id/tv_hdr"
           android:layout_width="fill_parent"
           android:layout_height="40dp"
           android:background="#31E2D9"
           android:layout_alignParentTop="true"
           android:text="Report"
           android:textSize="22dp"
           android:gravity="center"
           android:textColor="#ffffff"
           android:textStyle="bold"
           />

       <TextView
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:textSize="22dp"
           android:layout_below="@+id/tv_hdr"
           android:layout_marginTop="20dp"
           android:gravity="center"
           android:textStyle="bold"
           android:text="Are you sure want to report this post?"
           android:layout_centerHorizontal="true"
           android:textColor="#545454"
           android:id="@+id/tv_title" />

       <LinearLayout
           android:layout_width="fill_parent"
           android:layout_height="wrap_content"
           android:layout_alignParentBottom="true"
           android:weightSum="2"
           >
           <Button
               android:id="@+id/btn_ok"
               android:layout_width="wrap_content"
               android:layout_height="35dp"
               android:text="YES"
               android:textStyle="bold"
               android:textColor="#ffffff"
               android:background="@drawable/btn_selector"
               android:layout_weight="1"/>

           <View
               android:layout_width="1dp"
               android:layout_height="30dp"
               android:background="#ffffff"/>

           <Button
               android:id="@+id/btn_cancel"
               android:layout_width="wrap_content"
               android:layout_height="35dp"
               android:text="NO"
               android:textStyle="bold"
               android:textColor="#ffffff"
               android:background="@drawable/btn_selector"
               android:layout_weight="1"/>    
       </LinearLayout>

   </RelativeLayout>

</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

android customdialog android-alertdialog

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

以JSON结构发送2d数组

我想通过Android应用程序以JSON结构发送2D数组.

我想要的整体结构是

{
                      "PED": {
                          "fun": "enviarPedido",
                          "txtUser":"123",
                          "md5Passwd": "123",                          
                          "arrArticulos":[
                                         [50,10,5,50],
                                         [51,9,6.5,58.5],
                                         [52,8,7,56],
                                         [53,7,8.5,59.5]
                                      ]
                  }
         }
Run Code Online (Sandbox Code Playgroud)

我想要从游标数据生成的2D数组并放入此JSON结构中

"arrArticulos":[
                [50,10,5,50],
                [51,9,6.5,58.5],
                [52,8,7,56],
                [53,7,8.5,59.5]
               ]
Run Code Online (Sandbox Code Playgroud)

什么可以解决方案?

arrays android json

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

从文件夹中获取所有 .json 文件,然后使用 C# 和 JSON.Net 序列化为单个 .Json 文件并序列化

我有很多 .json 文件,它们存储在一个文件夹中。现在我想将所有这些 .json 文件序列化到一个文件中。好吧,我开始如何继续它,但没有得到正确的方法。我的单个 .json 文件如下所示-

\n\n
{\n      "Name": "Holstentor",\n      "Shorttext": "The Holsten Gate is a city gate marking off the western boundary of the old center of the Hanseatic city of L\xc3\xbcbeck. This Brick Gothic construction is one of the relics of L\xc3\xbcbeck\xe2\x80\x99s medieval city fortifications and one of two remaining city gates, the other being the Citadel Gate  Because its two round towers and arched entrance are so well known it is regarded today as a symbol …
Run Code Online (Sandbox Code Playgroud)

c# serialization jsonserializer json.net deserialization

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

Android 应用程序链接与启动相同活动的多个域

这是我的AndroidManifest.xml文件

<activity
    android:name=".activity.LaunchActivity"
    android:autoVerify="true"
    android:configChanges="orientation|keyboardHidden|screenSize|screenLayout"
    android:label="@string/app_name"
    android:noHistory="true">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data
            android:host="subdomain1.domain.ext"
            android:path="/path1/subpath1/.*"
            android:scheme="https" />
    </intent-filter>
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data
            android:host="subdomain1.domain.ext"
            android:pathPattern="/path2/subpath2/..*"
            android:scheme="https" />
    </intent-filter>
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />

        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />

        <data
            android:host="subdomain2.subdomain1.domain.ext"
            android:pathPattern="^..*"
            android:scheme="https" />
    </intent-filter>
</activity>
<activity
    android:name=".activity.LoginActivity"
    android:configChanges="orientation|keyboardHidden|screenSize|screenLayout"
    android:label="@string/app_name" />
<activity
    android:name=".activity.MainActivity"
    android:configChanges="orientation|keyboardHidden|screenSize|screenLayout"
    android:label="@string/app_name" />
Run Code Online (Sandbox Code Playgroud)

我想使用 2 个域的 Android …

android intentfilter android-manifest android-intent applinks

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

通用方法调用混淆

我创建了一个函数

public <T> void someFunction(T object) {
    object.someMethod();
}
Run Code Online (Sandbox Code Playgroud)

我有两个类具有相同的someMethod()函数定义.我必须通过传递参数来调用函数,这两个类的对象取决于提供的输入.

java generics dynamic

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