小编Use*_*343的帖子

RunTimeException:无法序列化:通过ksoap将字节数组从android发送到java应用程序时出错

我必须将Byte数组发送到我的java应用程序来自Android设备.我在android中使用kso​​ap2,我在java中使用axis2创建了web服务,以接收该字节数组并在服务器上创建文件以进行进一步处理.

让我给你全部解释.我在android设备中记录一个wave文件,然后该wave文件需要在server.i上的java应用程序中发送.我在java应用程序中创建了一个web2服务,其中axis2名称为"get_wave_byte"将传入的字节数组再次转换为wave文件并将其存储在server中.从android设备我将波形文件作为字节数组发送,并将get_wave_byte()参数中的存储路径发送出去.

因此,我已经在android中创建了wave文件,之后我创建了一个将该wave文件转换为byte array的方法.在字节数组中转换wave文件的方法如下...

public static byte[] getBytesFromFile(File file) throws IOException {
        InputStream is = new FileInputStream(file);

        // Get the size of the file
        long length = file.length();

        // You cannot create an array using a long type.
        // It needs to be an int type.
        // Before converting to an int type, check
        // to ensure that file is not larger than Integer.MAX_VALUE.
        if (length > Integer.MAX_VALUE) {
            // File is too large
        }

        // Create the byte array …
Run Code Online (Sandbox Code Playgroud)

java serialization android bytearray android-ksoap2

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

"二进制运算符'〜='不能应用于类型的操作数'

我已经整合了Objective C框架以在我的Swift项目中使用.现在我的目标c框架我有一些Enum decalred alraedy

e.g.

enum LE_DEVICE_STATE
    {
        LE_DEVICE_STATE_DISCONNECTED=0,
        LE_DEVICE_STATE_CONNECTING,
         LE_DEVICE_STATE_CONNECTED,
        LE_DEVICE_STATE_UPDATING_FIRMWARE
    };
Run Code Online (Sandbox Code Playgroud)

但是现在当我尝试在开关盒中使用这个枚举时,它不允许我迅速并抛出错误

"二进制运算符'〜='不能应用于'LE_DEVICE_STATE'和'(LE_DEVICE_STATE)''类型的操作数

.so有人可以指导我如何编写此代码?

我试图做以下

switch (theDevice.state) {

            case LE_DEVICE_STATE_DISCONNECTED:
                self.btnConnect.setTitle("", forState: UIControlState.Normal)

            case LE_DEVICE_STATE_DISCONNECTED:
            self.btnConnect.setTitle("", forState: UIControlState.Normal)


        case LE_DEVICE_STATE_DISCONNECTED:
            self.btnConnect.setTitle("", forState: UIControlState.Normal)


        case LE_DEVICE_STATE_DISCONNECTED:
            self.btnConnect.setTitle("", forState: UIControlState.Normal)


            default:
            self.btnConnect.setTitle("", forState: UIControlState.Normal)


        }
Run Code Online (Sandbox Code Playgroud)

enums objective-c ios swift

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

如何在ajax函数进程中显示加载图像?

以下是我的ajax函数,它将在按钮点击时填充html div.现在我想要的是如何在此函数启动时显示加载器图像,并且在此函数exucte之后加载器将隐藏.

function campaignList(){
        $.ajax({
            type:'post',
            url:'<%=campaignListURL.toString()%>',
            data:{},
            success:function(data){
                $(".main_content").html(data);                              
            }
        });
    }
Run Code Online (Sandbox Code Playgroud)

我试过以下脚本

<script type="text/javascript">
$("#loading_layer").ajaxStart(function(){
       $(this).show();
     });
</script>
Run Code Online (Sandbox Code Playgroud)

但没有任何反应..以下是我的div,其中ajax加载器gif图像在那里,我想隐藏和显示

<div id="loading_layer" style="display: none">
Run Code Online (Sandbox Code Playgroud)

////////////////////////////////////////////////// ////////////////////////////上面是我问的ajx方法..但是如果我想在提交表格时做同样的事情那怎么能实现这个......?

以下是我提交表单的一个javascript的代码行

{一些用于表单验证的javascript代码,如果所有验证都是真的那么flag将是真的.....

   if (flag == true) {
    div.style.display = '';
 alert("");
    document.editadform.submit();
    }
         div.style.display = 'none';
        return flag;
Run Code Online (Sandbox Code Playgroud)

}

以下是我的一个div,它是img,我想隐藏在形式的底层上,当它完成时我想隐藏

"/>

所以任何人都可以指导我这个问题吗?

ajax jquery progress-bar

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

AUI没有定义,Liferay在jsp页面中没有定义错误?

我在liferay中使用我的自定义portlet.但不知何故,当我运行我的portlet我在错误控制台中有以下错误

Timestamp: 12/10/2012 12:33:19 PM
Error: ReferenceError: AUI is not defined
Source File: http://localhost:8080/eMenuAdvertise-portlet/js/jquery.min.js
Line: 4

Timestamp: 12/10/2012 12:34:21 PM
Error: ReferenceError: Liferay is not defined
Source File: http://localhost:8080/eMenuAdvertise-portlet/js/jquery.min.js
Line: 3
Run Code Online (Sandbox Code Playgroud)

那么为什么这个错误会出现在我的jsp页面中的一些jquery?

<%@ page import="net.sf.jasperreports.engine.JRException"  %>
<%@ page import="net.sf.jasperreports.engine.JasperExportManager" %>
<%@ page import="net.sf.jasperreports.engine.JasperFillManager" %>
<%@ page import="net.sf.jasperreports.engine.JasperPrint" %>
<%@ page import="net.sf.jasperreports.engine.JasperPrintManager" %>

<%@page import="com.liferay.portal.model.Role"%>
<%@ include file="/init.jsp"%>
<%@page import="com.liferay.portal.model.Organization"%>
<%@page import="com.liferay.portal.util.PortalUtil"%>
<style>
.borderColor{border: 1px solid #C62626;}
</style>
<portlet:renderURL var="ajaxaddnewrestURL">
    <portlet:param name="jspPage" value="/jsps/ajaxnewrest.jsp" />
</portlet:renderURL>
<portlet:renderURL var="editrestURL">
    <portlet:param name="jspPage" value="/jsps/Ajax_editrest.jsp" /> …
Run Code Online (Sandbox Code Playgroud)

portlet liferay liferay-6 liferay-theme

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

如何从jasper导出到标准excel文件与图像和单元格边框和excel文件看起来像普通的Excel文件?

我正在使用jasper报告在我的liferay自定义portlet JSP页面中导出我的excel报告.

现在发生的事情是当我设置IS_IGNORE_GRAPHICS属性为false然后在excel报告中显示图像.然后excel报告列没有显示任何边框..如果我将其设置为true然后它不显示图像然后每列都带有边框..现在我想要的是excel报告上的图像以及excel报告的单元格边框.

以下是我的jrxml文件

<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="RestaurantReport" language="groovy" pageWidth="595" pageHeight="520" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" isFloatColumnFooter="true">
    <property name="ireport.zoom" value="1.1000000000000032"/>
    <property name="ireport.x" value="0"/>
    <property name="ireport.y" value="0"/>
    <property name="net.sf.jasperreports.export.xls.ignore.graphics" value="false"/>
    <style name="table">
        <box>
            <pen lineWidth="1.0" lineColor="#000000"/>
        </box>
    </style>
    <style name="table_TH" mode="Opaque" backcolor="#F0F8FF">
        <box>
            <pen lineWidth="0.5" lineColor="#000000"/>
        </box>
    </style>
    <style name="table_CH" mode="Opaque" backcolor="#BFE1FF">
        <box>
            <pen lineWidth="0.5" lineColor="#000000"/>
        </box>
    </style>
    <style name="table_TD" mode="Opaque" backcolor="#FFFFFF">
        <box>
            <pen lineWidth="0.5" lineColor="#000000"/>
        </box>
    </style>
    <subDataset name="Table Dataset 1"/>
    <field name="advertisename" class="java.lang.String"/>
    <field …
Run Code Online (Sandbox Code Playgroud)

java jsp jasper-reports export-to-excel ireport

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

如何在Uphone的导航栏中添加UILabel UIImageView?

UI的iphone应用程序中有一些导航栏.现在我想在导航栏中心的导航栏上添加两个图像..我已经在导航栏上成功添加了两个UIImageView,但我的问题是我有两个UIImageView带有标签的..

让我告诉你快照......在此输入图像描述

现在我的问题是我不知道如何UIImageView在导航栏中添加这种标签..所以,如果有人可以指导我这个,那么它将帮助我很多..

我已经使用此代码在导航栏上成功插入了两个图像.

   UIImageView *Messageview = [[UIImageView alloc] initWithImage:[UIImage imageNamed :"message.png"]];
        Messageview.frame=CGRectMake(10, 0, 40, 40);

        UIImageView *BirthdayView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:"birthday.png"]];
        //titleView.frame=CGRectMake(60, 0, 50, 50);

UIBarButtonItem *flexible = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];

    [flexible setWidth:20];
    UIBarButtonItem *flexible1 = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];

    [flexible setWidth:20];


        UIBarButtonItem *MessageBtn=[[UIBarButtonItem alloc]initWithCustomView:Messageview];

        UIBarButtonItem *BirthdayBtn=[[UIBarButtonItem alloc]initWithCustomView:BirthdayView];
        self.navigationItem.rightBarButtonItems=[NSArray arrayWithObjects:rofileBtn,flexible,BirthdayBtn,MessageBtn,flexible1,nil];
Run Code Online (Sandbox Code Playgroud)

请尽快指导我..

iphone uinavigationbar uinavigationitem ios xcode4.5

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

如何在Android上触摸事件的曲线上移动图像?

我在画布上绘制了一个Cubic Curve

 myPath.cubicTo(10, 10, w, h/2, 10, h-10);
Run Code Online (Sandbox Code Playgroud)

我在该屏幕上有四个ImageView,当我用触摸拖动图像时,我想在绘制的曲线上移动ImageViews.

我已经提到了这些链接:

在曲线路径上移动图像

在曲线上移动对象

在曲线上移动imageview

我得到的是,动画在曲线上移动图像的持续时间由t定义.但我想仅在该曲线区域的方向上触摸ImageView.

以下是我的屏幕: 在此输入图像描述

所以,我希望所有(x,y) co-ordinates曲线都只在该曲线上移动ImageView.

否则,我想要一个方程式绘制曲线,以便我可以为触摸的y值插入x值.

我已经瞪了很多但没有成功.任何建议或指导都会对我有所帮助.

android android-canvas

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

NsArray ContainsObject不使用Custom NsObject Class

我正在检查我的一个数组是否包含了Nsobject我创建的自定义方式.我正在使用ContainsObjectmethod.my问题是包含对象不能正常工作.即使我在数组中有相同的对象它没有返回真值.

if([self.arrSelectedInterest containsObject:interest_ent])
Run Code Online (Sandbox Code Playgroud)

我还附加了我的调试点的屏幕截图,显示了nsarray和比较对象的值,并且我发现它interest_ent是一个包含in的同一个对象,self.arrSelectedInterest 但它总是返回false.

在此输入图像描述

任何人都知道如何检查我的自定义nsobject的nsarray是否包含特定的对象?

以下是我的哈希和isEqual方法,我已经覆盖并在nsobejct中抛出我的属性类型.@interface InterestEntity:JSONModel

@property (strong, nonatomic) NSString* InterestId;
@property (strong, nonatomic) NSString* Name;
@property (strong, nonatomic) NSString<Optional>* Code;
@property (strong, nonatomic) NSString<Optional>* Description;
@property (strong, nonatomic) NSArray<Optional>* Hashtags;


- (NSUInteger)hash {
    NSUInteger result = 1;
    NSUInteger prime = 31;

    result = prime * result + [self.InterestId hash];
    result = prime * result + [self.Name hash];
    result = prime * result + [self.Code hash];
    result = prime * result …
Run Code Online (Sandbox Code Playgroud)

compare objective-c nsarray nsobject ios

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

如何制作可以直接运行的.exe或可执行jar?

可能重复:
如何创建可执行Java程序?

我已经在java.its中实现了一些语音识别应用程序,当我从eclipse运行时,eclipse运行良好..但是当我试图从命令行运行时我的代码没有运行..

我从sphinx中包含了一些jar ..像sphinx.jar,jsapi.jar,wsj_dictionary.jar,我的目录结构如下:

我的目录结构

所以有人可以建议我如何制作.exe或可以直接运行的可执行jar文件?

提前致谢..

java exe jar executable-jar runnable

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

如何删除动态创建的UIView和UILabel文本?

我正在添加一些名为*cellSeparator和其他UILabels的动态UIView ...现在发生的事情是当我再次调用此代码然后重写标签文本并覆盖以前创建的标签文本...我对此不是很了解ios development.so任何人都可以告诉我如何在再次创建之前动态删除这个UIView?因为UIView是动态创建的我不知道如何删除该UIview

  UILabel *indexLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, self.view.frame.size.height-150, self.view.frame.size.width/2,30)];
            [indexLabel setBackgroundColor:[UIColor clearColor]];
            indexLabel.textColor = [UIColor whiteColor];
            indexLabel.text = @"Details:-";
            indexLabel.font = [UIFont systemFontOfSize:20.00];
            UILabel *tagLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, self.view.frame.size.height-120, self.view.frame.size.width/2, 30)];
            tagLabel.backgroundColor = [UIColor clearColor];


            NSLog(@"LOg %@",imageId);
            NSLog(@"LOg %@",imageStyle);
            NSLog(@"LOg %@",imageType);
            NSLog(@"LOg %@",imageWeight);
            tagLabel.text = [NSString stringWithFormat:@"The Id of Jewl Is:  %@",imageId];

            imageTypelabel= [[UILabel alloc] initWithFrame:CGRectMake(20, self.view.frame.size.height-90, self.view.frame.size.width/2, 30)];
            imageTypelabel.backgroundColor = [UIColor clearColor];
            imageTypelabel.text = [NSString stringWithFormat:@"The Type of Jewl Is:  %@",imageType];
            imageStylelabel = [[UILabel alloc] initWithFrame:CGRectMake(20, …
Run Code Online (Sandbox Code Playgroud)

uiview ios

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

在iTunes Connect中,在Pending Developer Release中取消版本并上传新版本时,应用程序版本可以相同吗?

我遇到一种情况,我需要更新当前的开发人员待发布版本,而不必将我的应用程序版本更改为App Store。

我们已经在iTunes Connect中发布了1.0.0,但尚未发布,但Apple批准了该版本,因此它处于“待开发人员发布”状态。

所以问题是,如果我在待处理开发人员发布状态下取消此版本并上传新的版本,我的应用程序版本(1.0.0)是否可以相同,还是我需要强制更改应用程序版本(例如1.0.1)?我不想更改应用程序版本。

让我知道是否有可能,是否有人经历过同样的事情。

itunesconnect app-store appstore-approval ios

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