小编Adi*_*nia的帖子

Android youtube/gdata api在运行proguard后无法正常工作

运行proguard后,有没有人遇到过youtube api的问题?我在运行proguard之前从youtube上获取视频的代码运行得很好,在运行proguard后我得到了奇怪的异常

 ERROR/AndroidRuntime(10197): Caused by: java.lang.IllegalArgumentException: 
No parser defined for Content-Type: application/atom+xml; charset=UTF-8; type=feed
Run Code Online (Sandbox Code Playgroud)

我没有在任何地方设置内容类型,我使用的是创建新项目时生成的默认proguard.cfg文件.
运行proguard后有没有人面临类似的问题?尝试没有混淆的proguard,没有优化,但它给出了相同的结果.

android proguard

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

正确的C演员

我不太确定正确的强制转换,特别是来自unsigned int和#defines(无论什么类型)要加倍.

在这个例子中

#define SPEEDSENSOR_EDGES_NUM 10

int speed_counter_left;

double result = speed_counter_left / SPEEDSENSOR_EDGES_NUM;
Run Code Online (Sandbox Code Playgroud)

当speed_counter_left <10时,结果始终为0.

所以我加入了一些演员阵容:

double result = (double) ((double) speed_counter_left / (double) SPEEDSENSOR_EDGES_NUM);
Run Code Online (Sandbox Code Playgroud)

这是正确的,但我认为有太多演员阵容.如何用最少的演员表找出正确的方法?

c casting

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

通用匹配模式('/**')在过滤器链中的其他模式之前定义,导致它们被忽略

我在Spring 3.1.3发行版和以下应用程序上下文文件中遇到了这个问题.我不太清楚为什么会这样.已经查看了与此相关的大部分帖子.我不认为我的版本不匹配.

应用上下文文件:

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:security="http://www.springframework.org/schema/security"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
          http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
          http://www.springframework.org/schema/security
          http://www.springframework.org/schema/security/spring-security-3.1.xsd">

<security:http auto-config='true' entry-point-ref="casEntryPoint" >
    <security:intercept-url pattern="/panelpipeline/**" access="ROLE_USER"/>
    <security:intercept-url pattern="/**" access="IS_AUTHENTICATED_ANONYMOUSLY"/>
</security:http>

<bean id="serviceProperties" class="org.springframework.security.cas.ServiceProperties">
    <property name="service"
        value="https://seqdws1/cas/j_spring_cas_security_check" />
    <property name="sendRenew" value="false" />
</bean>

<security:http entry-point-ref="casEntryPoint">
    <security:custom-filter position="CAS_FILTER"
        ref="casFilter" />
</security:http>

<bean id="casFilter"
    class="org.springframework.security.cas.web.CasAuthenticationFilter">
    <property name="authenticationManager" ref="authenticationManager" />
</bean>

<bean id="casEntryPoint"
    class="org.springframework.security.cas.web.CasAuthenticationEntryPoint">
    <property name="loginUrl" value="https://seqdws1/cas/login" />
    <property name="serviceProperties" ref="serviceProperties" />
</bean>

<security:authentication-manager alias="authenticationManager">
    <security:authentication-provider
        ref="casAuthenticationProvider" />
</security:authentication-manager>

<bean id="casAuthenticationProvider"
    class="org.springframework.security.cas.authentication.CasAuthenticationProvider">
    <property name="userDetailsService" ref="userService" />
    <property name="serviceProperties" ref="serviceProperties" />
    <property name="ticketValidator"> …
Run Code Online (Sandbox Code Playgroud)

spring-security

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

查询表使每行成为3行(SQL服务器)

我在SQL服务器中有一个表(T1),

id     subject     student1      student2     student3     score1      score2     score3
1      Maths       Peter         Leo          John         11          12         13
2      Phy         Mary          May          Leo          21          22         23
Run Code Online (Sandbox Code Playgroud)

是否可以使用查询来产生以下结果:

id    subject   name      score
1     Maths     Peter     11
1     Maths     Leo       12
1     Maths     John      13
2     Phy       Mary      21
2     Phy       May       22
2     Phy       Leo       23
Run Code Online (Sandbox Code Playgroud)

非常感谢.

圣诞节快乐!!

sql sql-server

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

从短信表中获取发件人的联系人姓名?

我使用以下内容从收件箱中获取短信

ContentResolver cr = getContentResolver();
    Cursor cur = cr.query(Uri.parse("content://sms"), null,null,null, null);        
    DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");

     cursor_count=cur.getCount();

    if(cur.moveToFirst())
    {           
        do {

            sender.add(cur.getString(2));

            msg.add(cur.getString(11));
            date.add(formatter.format(Long.parseLong(cur.getString(4))));
        } while (cur.moveToNext());
Run Code Online (Sandbox Code Playgroud)

我从地址字段中获取此人的地址,但我还想获取发件人的联系人姓名(如果存储在我的联系人中).
person字段总是返回null,为什么?

android

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

如果内部包含childlayout,则使整个布局可滚动

我想让我的视图可滚动,我的视图包含线性布局内的子视图布局.

我的代码如下; 请使其可滚动,以便显示每个内容...

    <?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    android:background="#1A77BD">
    <RelativeLayout
        android:layout_marginTop="15dip"
        android:layout_marginLeft="8dip"
        android:layout_marginRight="8dip"
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:background="#FFFFFF">
        <TextView
            android:layout_marginTop="3dip"
            android:id="@+id/version"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="TYPE"
            android:layout_marginLeft="5dip"
            android:textColor="#000000" />
        <Spinner
            android:id="@+id/spinner1"
            android:layout_marginTop="0dip"
            android:layout_marginLeft="100dip"
            android:layout_height="40dip"
            android:layout_width="200dip" />
        <TextView
            android:id="@+id/update_me"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="DATE"
            android:layout_marginTop="80dip"
            android:layout_marginLeft="5dip"
            android:textColor="#000000" />
    </RelativeLayout>
    <RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="15dip"
        android:layout_marginLeft="8dip"
        android:layout_marginRight="8dip"
        android:background="#FFFFFF">
        <TextView
            android:id="@+id/accsetting"
            android:layout_marginLeft="5dip"
            android:layout_marginTop="2dip"
            android:textColor="#000000"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="COUNTRY" />
        <Spinner
            android:id="@+id/spinner3"
            android:layout_marginTop="0dip"
            android:layout_marginLeft="100dip"
            android:layout_height="40dip"
            android:layout_width="200dip" />
        <TextView
            android:layout_marginLeft="5dip"
            android:layout_marginTop="52dip"
            android:textColor="#000000"
            android:id="@+id/savecorp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="STATE" /> …
Run Code Online (Sandbox Code Playgroud)

android

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

URL重写查询数据库?

我试图了解URL重写的工作原理.我有以下链接.

mysite.com/profile.php?id=23
Run Code Online (Sandbox Code Playgroud)

我想用用户的名字和姓氏重写上面的url.

mysite.com/directory/liam-gallagher
Run Code Online (Sandbox Code Playgroud)

从我读过的内容中你可以指定url应该输出的规则,但是如何查询我的表以获取每个用户名?

对不起,如果这很难理解,我自己也很困惑!

php mysql url seo url-rewriting

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

如果输入了多个字符,则RegularExpressionValidator将失败

这是我的 asp:RegularExpressionValidator

  <asp:RegularExpressionValidator ID="RegularExpressionValidator2" 
                runat="server" ControlToValidate="uxTrachoCtrl1"
                ErrorMessage="Ne dois pas contenir des caractères alphabétiques"  
                ValidationExpression="[0123456789,.<>=]" ValidationGroup="verification" Display="Dynamic" 
                SetFocusOnError="True">
            </asp:RegularExpressionValidator>    
Run Code Online (Sandbox Code Playgroud)

该字符串只能包含那些字符0123456789,.<> =

这是我的正则表达式[0123456789,.<,>,=]

如果我输入一个像f或1这样的字符,它就可以工作,但如果我输入多个字符,则会产生错误:

ex: input="1"=ok
    input="f"=error
    input="11"=error (It's supposed to be right)
Run Code Online (Sandbox Code Playgroud)

regex asp.net

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

AND操作的错误答案

我试图在缓冲区上执行AND操作,填充所有1.
我正在编写下面的代码,

unsigned char pTemp[1024];
 memset(pTemp,0xFF,1024);
printf("AND - %d ",((unsigned char)pTemp[0] && 0x2));
Run Code Online (Sandbox Code Playgroud)

我得到了答案 - 1.

请让我知道发生了什么.提供解决方案.

c

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

Android相对布局 - 将图像对齐到右侧

我想有以下布局:
在此输入图像描述

布局由3个图像(Image1,Image2,Image3)和
2个TextView(Text1和Text2)组成,
Image2和Image3是可选的.

想法是使用具有以下约束的RelativeLayout:
- Text1位于image1
的右侧
- Text2位于image1的右侧- Text2位于Text1的下方
- Image2 位于Text1 的右侧(并且右侧对齐)
- Image3在Text2的右侧(并向右对齐)

XML

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="?android:attr/listPreferredItemHeight"
    android:padding="6dip" >

<ImageView
    android:id="@+id/Image1"
    android:layout_width="wrap_content"
    android:layout_height="fill_parent"
    android:layout_alignParentLeft="true"
    android:layout_marginRight="6dip" />

<TextView
    android:id="@+id/Text1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_alignWithParentIfMissing="true"
    android:layout_toRightOf="@id/Image1"
    android:textSize="16sp" />

<TextView
    android:id="@+id/Text2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@+id/Text1"
    android:layout_toRightOf="@id/image1"
    android:singleLine="true"
    android:textSize="12sp" />

<ImageView
    android:id="@+id/Image2"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:layout_toRightOf="@id/Text1" />

<ImageView
    android:id="@+id/Image3"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:layout_below="@+id/Image2"
    android:layout_toRightOf="@id/Text2" />

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

问题:
至于现在,我无法将Image2和Image3对齐到右边.
如何控制Image1和Image2的大小?

android android-layout

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

无法解析符号'activity_main.xml'

我关注 https://github.com/Ajay191191/Opencv-Face-Recognition

下图显示了在activity_main.xml和两个红色圆圈下面具有相同错误的错误. 在此输入图像描述

代码是:

package com.example.altaf.opencv_test;


import android.content.Intent;
import java.io.BufferedWriter;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.FileWriter;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.OutputStream;
 import java.util.HashMap;
 import java.util.Map;
import android.support.v7.app.AppCompatActivity;
 import org.opencv.objdetect.CascadeClassifier;

 import android.app.Activity;
 import android.content.Intent;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
 import android.os.Bundle;
 import android.os.Environment;
 import android.util.Log;
import  android.R;
 import android.view.Menu;
 import android.view.View;
 import android.widget.Button;
 import android.widget.ImageView;
 import android.widget.TextView;
 import android.widget.Toast;

 public class MainActivity extends Activity {

     Button detect_face, add_name, take_picture;
     TextView tv;
     TextView detectedName;
     private String …
Run Code Online (Sandbox Code Playgroud)

android opencv

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

得到错误java.lang.RuntimeException

我是Android新手.我收到错误java.lang.NullPointerException,java.lang.RuntimeException申请人关闭.

10-18 06:04:12.676: E/AndroidRuntime(340): FATAL EXCEPTION: main
10-18 06:04:12.676: E/AndroidRuntime(340): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.md.ExpertRemote/com.md.ExpertRemote.first.ExpertRemote}: java.lang.NullPointerException
10-18 06:04:12.676: E/AndroidRuntime(340):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
10-18 06:04:12.676: E/AndroidRuntime(340):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
10-18 06:04:12.676: E/AndroidRuntime(340):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
10-18 06:04:12.676: E/AndroidRuntime(340):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
10-18 06:04:12.676: E/AndroidRuntime(340):  at android.os.Handler.dispatchMessage(Handler.java:99)
10-18 06:04:12.676: E/AndroidRuntime(340):  at android.os.Looper.loop(Looper.java:123)
10-18 06:04:12.676: E/AndroidRuntime(340):  at android.app.ActivityThread.main(ActivityThread.java:4627)
10-18 06:04:12.676: E/AndroidRuntime(340):  at java.lang.reflect.Method.invokeNative(Native Method)
10-18 06:04:12.676: E/AndroidRuntime(340):  at java.lang.reflect.Method.invoke(Method.java:521)
10-18 06:04:12.676: E/AndroidRuntime(340):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
10-18 06:04:12.676: E/AndroidRuntime(340):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
10-18 06:04:12.676: E/AndroidRuntime(340): …
Run Code Online (Sandbox Code Playgroud)

java android view

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