小编Lei*_*igh的帖子

FlexJSON不会完全序列化类对象

我是FlexJson的新手,并且正在关注http://flexjson.sourceforge.net/以获得简单的教程.
我写了一个简单的程序,但似乎没有序列化对象属性.如果有人知道,请帮助我

package com.webapp.enter;

import flexjson.JSONSerializer;

class PObject {

       String name;
       int age;
       String country;

        public PObject (String n, int a , String c){
            this.name = n;
            this.country = c;
            this.age = a;
        }

        public String toString(){
            return this.name + this.age + this.country;
        }

        public String[] getData(){
            return new String[]{ this.name, this.country};
        }
}

public class Person{

    public static void main(String main[]){
        PObject person = new PObject("harit",23,"india");
        System.out.println(person.name +  " - " + person.age + " - " …
Run Code Online (Sandbox Code Playgroud)

java json flexjson

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

Coldfusion CFC - 函数返回的值不是查询类型?

对于派对而言,我正试图转向使用CFC来简化事情.在这个阶段,我只是试图找到我的脚并理解它们 - 使用CFWACK 9作为指导.

但是,我的第一次尝试让我难过!

这是我在CFC中的内容;

<cffunction name="listBlogEntries" returntype="query" output="false" 
      access="remote" hint="Find all blog entries by blogid, sorted by id desc">

    <cfargument name="blogid" required="true" default="24">
    <cfset var getBlogEntries = "">

    <cfquery name="getBlogEntries">
        SELECT  ID, entry_title 
        FROM    blog_entries 
        WHERE  blogID='#ARGUMENTS.blogid#'
        ORDER BY ID DESC 
        LIMIT 10
    </cfquery> 
</cffunction>

<cffunction name="printBlogEntries" returntype="void" access="remote" 
      hint="Lookup blog entries and return formatted">

        <cfargument name="blogid" required="true" default="24">
        <cfset var qBlogEntries  = listBlogEntries(ARGUMENTS.blogid)>
        <cfoutput query="qBlogEntries">
            <h1>Entry ID: #qBlogEntries.ID#</h1>
            <h3>Entry Title: #qBlogEntries.entry_title#</h3>
        </cfoutput>

        <cfreturn>

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

我打电话给.cfm页面;

<cfparam name="blogid" …
Run Code Online (Sandbox Code Playgroud)

coldfusion

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

Java异常错误 - Sqlite preparedStatement.setBlob

我将数据放入数据库,它可以是MYSQL数据库(服务器)或SQLITE数据库(路上的平板电脑).Java应用程序每天与服务器同步,上传新数据并下载任何新数据.那部分运作良好.但是,要求它也能够处理图像.

我们选择在数据库中使用blob,而不是实现一个依赖于将图像复制到每端文件系统的全新系统.对那些不这样做的回复并不感兴趣;)我真正需要帮助的是当我尝试编写blob时,我在调度中得到一个异常.

我们正在从数据库构造输入表单,因为整个应用程序正在用于不同的目的,这取决于数据库.输入表单允许您将图像附加到记录,我们将其存储为base64字符串.然后将其解码为byte [].

我的测试程序在字符串和字节数组之间来回转换(最终是一个Image)没问题.所以我相信问题是在准备好的声明中设置Blob,但我可能是错的.

单击"保存"按钮后发生"异常".

Exception occurred during event dispatching:
java.lang.AbstractMethodError: org.sqlite.PrepStmt.setBlob(ILjava/io/InputStream;J)V
    at tabletapp.database.DB.prepareStatement(DB.java:641)
    at tabletapp.database.DB.save(DB.java:743)
    at tabletapp.FormPanel.saveData(FormPanel.java:546)
Run Code Online (Sandbox Code Playgroud)

违规代码块

public void prepareStatement(String table, String sql, LinkedHashMap<String, String> data) {
    try {
        String typeID = "";
        PreparedStatement ps = connection.prepareStatement(sql);
        log.debug("Preparing SQL: " + sql.replace("\n", ""));
        int parameterIndex = 1;

        //for (String columnName : getColumnNames(table)) {
        for (String columnName : data.keySet()) {
            typeID = getColumnType(table, columnName);

            if (data.containsKey(columnName)) {
                String value = data.get(columnName);
                if (value == null || "".equals(value)) { …
Run Code Online (Sandbox Code Playgroud)

java mysql database sqlite exception

7
推荐指数
2
解决办法
3431
查看次数

ColdFusion:关于使用自定义"自己编写的"Java类

我需要在cfml页面中使用我自己的java类.

文档中的这个条目听起来不错,但没有解释我必须创建哪些文件.

我试图test.cfm在我的网站根目录下创建一个页面.然后将TestClass.java+ TestClass.class放在同一条路径中.但这会导致错误"找不到课程"!

你能帮我么?

java coldfusion class classpath coldfusion-10

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

如果存在或存在?

是否可以EXISTS在单个IFSQL语句中测试两个条件?我尝试了以下内容.

IF EXIST (SELECT * FROM tblOne WHERE field1 = @parm1 AND field2 = @parm2) 
   OR 
   EXIST (SELECT * FROM tblTwo WHERE field1 = @parm5 AND field2 = @parm3) 
Run Code Online (Sandbox Code Playgroud)

我试过IF在那里添加额外的括号,但无济于事.

你能用正确的语法帮助我吗?

sql sql-server conditional exists

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

iOS:崩溃并重新启动应用程序后可以打开以前的viewController吗?

如何实现以下这些东西?请给我一些指导.我在下面描述我的问题.

当我点击主页按钮并从托盘中删除应用程序时,当我打开应用程序时,我得到登录屏幕.我知道怎么用NSUserDefaults得好.

但我的问题是,当我导航第3或第4个viewController并按下主页按钮并从托盘中删除应用程序时,然后每当我打开应用程序时,我想打开最后一次打开viewController.

同样当我的应用程序崩溃并且我再次打开它然后我想打开最后打开viewController状态的应用程序.

所以我只是想知道那可能与否?如果是,那么请指导我如何实现这个目标.

谢谢

iphone objective-c ios

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

控制台应用程序中的倒计时器

我有一个控制台应用程序,我想创建一个倒数计时器.这是我尝试过的:

    static void Main(string[] args)
    {
        for (int a = 10; a >= 0; a--)
        {
            Console.Write("Generating Preview in {0}", a);
            System.Threading.Thread.Sleep(1000);
            Console.Clear();
        }
    }
Run Code Online (Sandbox Code Playgroud)

此代码适用于某些情况.但是,问题是它会清除整个控制台窗口,并且当计时器上方有一些字符时无法使用.

c# timer console-application

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

将新行数据添加到gridview asp.net c#

我用这段代码创建了一个类:

public class Customer
{
    public Customer() { }
    public Customer(Customer cust)
    {
        ID = cust.ID;
        Name = cust.Name;
        FatherName = cust.FatherName;
        Email = cust.Email;
    }
    public int ID { get; set; }
    public string Name { get; set; }
    public string FatherName { get; set; }
    public string Email { get; set; }
}
Run Code Online (Sandbox Code Playgroud)

并创建此函数以加载包含一些数据的列表:

public List<Customer> Generate_Data()
{
    List<Customer> lstCustomer = new List<Customer>();
    Customer customer = new Customer();

    customer.ID = 1;
    customer.Name = "John Cena";
    customer.FatherName = "John"; …
Run Code Online (Sandbox Code Playgroud)

c# asp.net gridview

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

JavaScript/jQuery VIN验证器

有没有人创建过VIN验证器?我正在尝试创建一个文本框,用户将在其中输入车辆识别号码,然后JS/jQuery将验证其是否正确,以防他们输入数字错误.

我是JS/jQuery的新手,并且发现了一些例子,但当然无法使它们正常工作......任何有任何想法或建议的人都会非常感激,特别是如果你能告诉我怎么做设置我下面的工作正常!

注意:isVin()函数cflib.org提供

HTML:

<label name="vin">VIN</label>
<input type="text" name="vin" />
Run Code Online (Sandbox Code Playgroud)

ColdFusion的:

<cfscript>
/**
 * US Vehicle Identification Number (VIN) validation.
 * version 1.0 by Christopher Jordan
 * version 1.1 by RHPT, Peter Boughton &amp; Adam Cameron (original function rejected valid VINs)
 * 
 * @param v      VIN to validate (Required)
 * @return Returns a boolean. 
 * @author Christopher Jordan (cjordan@placs.net) 
 * @version 1, February 19, 2013 
 */
function isVIN(v) {
    var i = "";
    var d = ""; …
Run Code Online (Sandbox Code Playgroud)

javascript regex coldfusion jquery

7
推荐指数
2
解决办法
7593
查看次数

LinkedIn新API - 无法获得r_network权限

我继承了一个用旧的LinkedIn API编写的程序,我正在尝试将其迁移到新的API.当我尝试获得r_basicprofile许可时,我的oauth令牌有效.但是,当我尝试r_network或者rw_nus,我得到了回应

无效范围 - 您的应用程序尚未获得r_network的授权.

然而,当我去www.linkedin.com/developer/apps/xxxx/auth,在箱子r_networkrw_nus检查.

即,请求

https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=xxxxxx&scope=r_basicprofile&state=yyyy&redirect_uri=http%3A%2F%2Fkalatublog.com%2Fwp-content%2Fmu-plugins%2Fimb-en%2Fhelpers%2Fsocial-connect%2Fapi%2Ffinalize.php%3Fapi%3Dlinkedin%26ch%zzzzz

工作,但要求

https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=xxxxxx&scope=r_network&state=yyyy&redirect_uri=http%3A%2F%2Fkalatublog.com%2Fwp-content%2Fmu-plugins%2Fimb-en%2Fhelpers%2Fsocial-connect%2Fapi%2Ffinalize.php%3Fapi%3Dlinkedin%26ch%zzzzz

给出了这个错误.我究竟做错了什么?

linkedin

7
推荐指数
2
解决办法
8735
查看次数