深入分析J2ME平台MIDP高级事件处理机制

深入解析J2ME超级玛丽游戏源代码 J2ME(Java 2 Platform, Micro Edition)是为嵌入式设备设计的一个Java平台,由Sun Microsystems公司于1999年推出。它源自早期的Java平台,专为有限资源的消费电子设备,如手机、PDA等,进行了特别的优化。J2ME的推出,让开发者能够用熟悉的Java语言为不同的移动设备创建应用程序和游戏。超级玛丽(Super Mario)是任天堂公司推出的一款经典的平台跳跃游戏,首次发行于1985年。 阅读详情

      MIDP中的事件处理机制在J2ME用户图形界面开发中具有举足轻重的地位,本文将深入分析MIDP高级事件处理机制,本文提供的程序是新手学习不错的例子。在接下来的文章我会继续讲述低级事件处理机制。

      MIDP的事件处理处理机制同样是采用回调的机制,你可以参考AWT的事件处理原理。在MIDP中分高级事件处理和低级事件处理,前者主要是针对高级UI,而后者主要是这对Canvas这样的低级UI的。不管怎样,我们必须首先介绍的是Command类,移动信息设备的输入主要来自于手机的键盘,导航则主要是由按钮来完成的,例如软键和导航键。Command类包装了动作的信息,但是并没有包括动作触发后应该做什么,这些是在CommanListener内实现的。看看Command的构造器吧
Command command = new Command("退出",Command.EXIT,1),构造器的参数分别表示按钮的标签,按钮的类型和优先级别。移动信息设备是根据后面两个参数对按钮进行布局的。

      高级事件处理主要由两个接口来实现,一个是CommandListener,一个是ItemStateListener。在CommandListener中定义了方法commandAction(Command cmd,Displayable disp),我们必须实现这个方法来完成事件处理,告诉应用程序当在disp界面下如果cmd按钮并按下的时候他应该去做什么。ItemStateListener中定义了方法itemStateChanged(Item item),应用程序通过他来得到在Form内的item内部状态发生变化的事件。用户在进行如下操作的时候都会触发这样的事件,调整交互性Guage、在TextField内输入或者修改内容、修改DateField、改变ChoiceGroup的状态。

      尽管我们已经通过上面的介绍了解了事件处理的机制,但是你会发现我们进行用户界面导航的时候仍然非常的麻烦,因为这不是在浏览器上开发界面,我们能做的只能是通过Command来进行处理。下面我将通过一个例子来说明如何使用CommandListener和ItemStateListener,这个例子有两个界面一个界面用来输入另一个用来显示用户的输入。在输入界面如果我们选择click这个ChoiceGroup,界面会出现另外一个文本输入,如果我们不选择他就不会出现。在这样一个程序中充分说明了如何使用上述两个接口来完成MIDP高级事件的处理,但是也暴露出了导航难得问题,在以后的文章中我会介绍如何使用MVC的设计模式来解决这个问题。下面是程序执行的界面抓图


程序源代码如下所示:

//HighLevelMIDlet.java
import javax.microedition.lcdui.Display;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
/*
 * Created on 2004-6-24
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */

/**
 * @author P2800
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class HighLevelMIDlet extends MIDlet
{

    private Display display;
    private MainUI mainUI;
    private DisplayUI displayUI;
   
    /* (non-Javadoc)
     * @see javax.microedition.midlet.MIDlet#startApp()
     */
    protected void startApp() throws MIDletStateChangeException
    {
        // TODO Auto-generated method stub
        initMIDlet();

    }
   
    private void initMIDlet()
    {
        display = Display.getDisplay(this);
        mainUI = new MainUI(this);
        displayUI = new DisplayUI(this,mainUI);
        display.setCurrent(mainUI);
    }
   
    public DisplayUI getDisplayUI()
    {
        return displayUI;
    }
    public Display getDisplay()
    {
        return display;
    }

    /* (non-Javadoc)
     * @see javax.microedition.midlet.MIDlet#pauseApp()
     */
    protected void pauseApp()
    {
        // TODO Auto-generated method stub

    }

    /* (non-Javadoc)
     * @see javax.microedition.midlet.MIDlet#destroyApp(boolean)
     */
    protected void destroyApp(boolean arg0) throws MIDletStateChangeException
    {
        // TODO Auto-generated method stub

    }

}
//MainUI.java

import javax.microedition.lcdui.Choice;
import javax.microedition.lcdui.ChoiceGroup;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.Item;
import javax.microedition.lcdui.ItemStateListener;
import javax.microedition.lcdui.TextField;
import javax.microedition.midlet.MIDlet;

/*
 * Created on 2004-6-24
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */

/**
 * @author P2800
 *
 * TODO To change the template for this generated type comment go to Window -
 * Preferences - Java - Code Style - Code Templates
 */
public class MainUI extends Form implements CommandListener, ItemStateListener
{

    private HighLevelMIDlet midlet;
    private TextField inputField;
    private ChoiceGroup choice;
    private TextField inputField2;
    private int index;
    public static final Command cmd = new Command("Display", Command.ITEM, 2);

    public MainUI(HighLevelMIDlet midlet)
    {
        super("form");
        this.midlet = midlet;
        init();
    }

    public void init()
    {
       
        inputField = new TextField("Input", null, 25, TextField.ANY);
        inputField2 = new TextField("Input2", null, 25, TextField.ANY);
        choice = new ChoiceGroup("click", Choice.MULTIPLE);
        choice.append("Another", null);
        this.append(inputField);
        this.append(choice);
        this.addCommand(cmd);
        this.setCommandListener(this);
        this.setItemStateListener(this);

    }

    /*
     * (non-Javadoc)
     *
     * @see javax.microedition.lcdui.CommandListener#commandAction(javax.microedition.lcdui.Command,
     *      javax.microedition.lcdui.Displayable)
     */
    public void commandAction(Command arg0, Displayable arg1)
    {
        // TODO Auto-generated method stub
        if(arg0 == cmd)
        {
            String input = inputField.getString();
            System.out.println(input);
            midlet.getDisplayUI().setInput(input);
            midlet.getDisplay().setCurrent(midlet.getDisplayUI());
           
        }

    }

    /*
     * (non-Javadoc)
     *
     * @see javax.microedition.lcdui.ItemStateListener#itemStateChanged(javax.microedition.lcdui.Item)
     */
    public void itemStateChanged(Item arg0)
    {
        // TODO Auto-generated method stub
        if(arg0 == choice)
        {
           
            if(choice.isSelected(0) == true)
            {
                index = this.append(inputField2);
            }
            else
            {
                this.delete(index);
            }
        }

    }

}
//DisplayUI.java

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.StringItem;


/*
 * Created on 2004-6-24
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */

/**
 * @author P2800
 *
 * TODO To change the template for this generated type comment go to Window -
 * Preferences - Java - Code Style - Code Templates
 */
public class DisplayUI extends Form implements CommandListener
{

    private HighLevelMIDlet midlet;
    private StringItem displayItem;
    private Displayable backUI;
    public static final Command backCommand = new Command("Back", Command.BACK,
            2);

    public DisplayUI(HighLevelMIDlet midlet,Displayable backUI)
    {
        super("Display");
        this.midlet = midlet;
        this.backUI = backUI;
        init();
        this.addCommand(backCommand);
        this.setCommandListener(this);
    }

    private void init()
    {
        displayItem = new StringItem("you input", null);
        this.append(displayItem);
    }
   
    public void setInput(String input)
    {
        displayItem.setText(input);
    }
    /*
     * (non-Javadoc)
     *
     * @see javax.microedition.lcdui.CommandListener#commandAction(javax.microedition.lcdui.Command,
     *      javax.microedition.lcdui.Displayable)
     */
    public void commandAction(Command arg0, Displayable arg1)
    {
        // TODO Auto-generated method stub
        if(arg0 == backCommand)
        {
            midlet.getDisplay().setCurrent(backUI);
        }

    }

}

第一弹:llama.cpp编译 1.编译llama.cpp命令行(电脑版本);2.交叉编译安卓命令行版本。 阅读详情

相关推荐

微信支付开发之平台给用户转账到零钱的功能

请求消息中应包含商家批次单号、转账名称、appid、转账总金额、转账总笔数、转账openid、收款用户姓名等信息。批次已受理成功,若发起批量转账的30分钟后,转账批次单仍处于该状态,可能原因是商户账户余额不足等。【转账场景ID】 该批次转账使用的转账场景,如不填写则使用商家的默认场景,如无默认场景可为空,可前往“商家转账到零钱-前往功能”中申请。【转账总笔数】 一个转账批次单最多发起一千笔转账。【商家批次单号】 商户系统内部的商家批次单号,要求此参数只能由数字、大小写字母组成,在商户系统内部唯一。

程序员weixin_sodomany的博客 3461

java j2me 保存捕获的音频

importjavax.microedition.lcdui.Alert;importjavax.microedition.lcdui.Command;importjavax.microedition.lcdui.CommandListener;importjavax.microedition.lcdui.Display;importjavax.microedition.lcdui.D...

张天疯的专栏 134

C# 进程间 双内存共享 高帧率图像传输

演示了两个进程之间通过 双内存共享 的方式, 来实时处理图像,并以高帧率(40~60FPS)传输的基本示例。 进程间内存共享的优点:高性能、低延迟、资源效率高、简单可靠。 适用场景:实时图像处理、大数据传输、多进程协作、实时监控系统,等等。

qianqiansd 1999

如何清空界面的内容

import javax.microedition.midlet.*;import javax.microedition.lcdui.*;public class NotifyDemo extends MIDlet implements CommandListener{ Display display; Form form; Command exitCommand; C

HaiyuKing的专栏 722

基于物联网设计温室水培系统(NBIOT+华为云IOT)_338

本项目设计并实现了一套基于物联网的温室水培系统。系统以STM32F103RCT6单片机为核心控制器,结合SHT30温湿度传感器、SGP30二氧化碳传感器、BH1750光照传感器及液位检测传感器等硬件,实现对温室内环境参数的实时采集。系统支持自动和手动两种控制模式,能够根据传感器数据自动控制补光灯、通风风扇、遮光卷帘、降温水帘及营养液补充电机。通过NBIoT模块,系统可将采集的数据通过MQTT协议上传至华为云IOT平台,用户可通过Android手机APP或Windows上位机进行远程监控与控制。

422

置顶必读(1) | 滚雪球学Oracle教程导航帖,带你弯道超车(持续更新中)

什么是数据库管理系统(DBMS),Oracle在行业中的领先地位Oracle数据库的市场竞争与主要应用场景Oracle数据库的核心功能模块与未来技术发展趋势约束的高级应用:主键、唯一性、外键设计与管理表分区、视图、同义词与序列的最佳实践PL/SQL编程的设计哲学,如何高效使用Oracle SQL DeveloperPL/SQL代码调试与优化技巧RAC集群中的高可用性设计,负载均衡与并行查询的配置集群中的缓存一致性管理。

**My Coding Family** 1万+

AWT的语义事件和低级事件

AWT将事件分为低级(low-level)事件和语义(semantic)事件。语义事件是表示用户动作的事件,例如,点击按钮;因此,ActionEvent是一种语义事件。低级事件是形成那些事件的事件。在点击按钮时,包含了按下鼠标、连续移动鼠标、抬起鼠标(只有鼠标在按钮区中抬起才引发

银月 2503

openclaw 保姆级部署与核心玩法解析:国产DeepSeek模型 + 飞书

OpenClaw是一款功能强大的开源AI个人助理,支持全平台私有化部署,数据完全本地掌控。它不仅可通过聊天窗口直接操控电脑(安装软件、创建项目),还支持接入飞书等主流通讯工具,化身24小时在线的智能助理。本文提供了从零开始的详细部署教程,涵盖基础安装、模型配置(如GLM-4、DeepSeek)到飞书集成的完整实战指南,助你将这款“核动力”AI助手快速融入日常工作流。

甘蓝的专栏 3008

深入分析J2ME平台MIDP低级事件处理机制

原文:http://javaeye.5d6d.com/thread-90-1-1.html 深入分析J2ME平台MIDP低级事件处理机制  通常低级事件的处理是为了满足游戏开发的需要,因为游戏开发相关的问题非常复杂。因此不在这里进行阐述,有兴趣的朋友可以和我索要相关的游戏开发资料。MIDP定义了如下键值在Canvas类内:    KEY_NUM0  KEY_NUM1  KEY_NUM2  KE

无花专栏--http://www.ucweb.com 952

AgentScope实战训练营:从零搭建一个完整的A2A Agent应用

2024年4月,Google在Google Cloud Next大会上正式提出了A2A(Agent-to-Agent)协议,这是一个开放协议,旨在让不同的AI Agent之间能够像微服务一样相互发现、相互调用。通俗地讲:A2A协议就是AI Agent世界的HTTP协议——有了它,一个Agent可以把自己的能力以标准化的方式暴露出去,另一个Agent可以无缝地发现并调用它。本文将基于阿里巴巴开源的(Apache 2.0协议),手把手带你从零搭建一个完整的A2A Agent应用。

program哲学 579

大疆FPGA/芯片开发工程师(A卷)笔试题(含详解)

大疆芯片开发岗A卷 一、单选题 1.下列关于多bit数据跨时钟域的处理思路,错误的有   A、发送方给出数据,接收方用本地时钟同步两拍再使用   B、发送方把数据写到异步fifo,接收方从异步fifo里读出   C、对于连续变化的信号,发送方转为格雷码发送,接收方收到后再转为二进制   D、发送方给出数据,发送方给出握手请求,接收方收到后回复,发送方撤销数据 2.对12.918做无损定点化,需要的最小位宽是多少位,位宽选择11位时的量化误差是多少   A、12位,0.0118   B、13位,0.0039

Mr.翟的博客 2万+

本人编写的《J2ME开发精解》已经由电子工业出版社出版

J2ME开发网站长詹建飞编写的《J2ME开发精解》一书已经陆续在各个书店和网上书店上架,本书由电子工业出版社出版,SUN中国技术社区推荐java用书。目录如下:J2ME开发精解詹建飞 编著2006年1月出版ISBN 7-121-02210-949.00元(含光盘1张)416页 内容简介本书介绍如何在支持J2ME的设备上开发MIDP应用程序,尤其针对MIDP

mingjava的专栏 5503

[特殊字符] RK3588 平台上基于 Panfrost 的 Mesa 驱动编译全过程

摘要: 本文详细记录了在RK3588平台(Ubuntu 20.04 aarch64)上编译基于Panfrost的Mesa驱动的全过程。内容包括:1)系统依赖安装;2)libdrm编译;3)Mesa配置参数优化;4)LLVM 15与SPIRV工具链的安装方法;5)SPIRV-Tools版本问题的解决方案;6)最终编译命令及常见错误处理。关键点在于正确设置工具链路径(PKG_CONFIG_PATH)和版本匹配(LLVM 15对应SPIRV-LLVM-Translator v15.0.0),推荐将组件安装在/op

梁俊星的博客 943

分析MIDP的高级事件处理机制

作者:mingjava  文章来源:http://www.j2medev.com/Article/ShowArticle.asp?ArticleID=21MIDP中的事件处理机制在J2ME用户图形界面开发中具有举足轻重的地位,本文将深入分析MIDP高级事件处理机制,本文提供的程序是新手学习不错的例子。在接下来的文章我会继续讲述低级事件处理机制。    MIDP的事件处理处理机制同样是采用回调的机制

mobilechannel的专栏 706

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

(按键)深入分析J2ME平台MIDP低级事件处理机制

通常低级事件的处理是为了满足游戏开发的需要,因为游戏开发相关的问题非常复杂。因此不在这里进行阐述,有兴趣的朋友可以和我索要相关的游戏开发资料。MIDP定义了如下键值在Canvas类内:   KEY_NUM0   KEY_NUM1   KEY_NUM2   KEY_NUM3   KEY_NUM4   KEY_NUM5   KEY_NUM6   KEY_NUM7   KEY_NUM8

alleniversoncomputer的专栏 489

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

BREW & J2ME:在差别中联合

[出自: http://expert.imobile.com.cn]摘要 本系列面向那些习惯使用J2ME的手机开发者,或者那些对更轻便和更有效的代码生成感兴趣的BREW开发者。主要是受Java GUI模型的启发,当前的BREW_J2ME 框架可以处理J2ME中当作“高级别接口”的东西。关于如何提供确切的J2ME匹配-推理不在本文讨论范围之内,本文只是提供这两个领域的概述。 首先我将快速讨论BR

mobilechannel的专栏 5676

J2ME浅说

[u][i][b]1.J2ME采用模块化的结构[/b][/i][/u] 底层是宿主机的操作系统,内部则分为三层, Java Virtual Machine(虚拟机层); Configuration(配置层); Profile(简表层)。J2ME有两类虛拟机:CVM(C虚拟机)和KVM(K虚拟机), CVM功能比KVM功能更为强大; Configuration层:Configuration是J2M...

ittime 206

Record Management System从入门到精通系列之一

      Record Management System是J2ME的一个重要的子系统,目的是实现应用程序本地数据的持久性存储。目前支持文件系统的移动信息设备还有限,因此Record Management System是J2ME开发人员实现本地数据存储的首选途径。本文的目的就是全面的介绍Record Management System的知识。       顾名思义Record Managemen

mingjava的专栏 6563

RMS从入门到精通之一

 Record Management System是J2ME的一个重要的子系统,目的是实现应用程序本地数据的持久性存储。目前支持文件系统的移动信息设备还有限,因此Record Management System是J2ME开发人员实现本地数据存储的首选途径。本文的目的就是全面的介绍Record Management System的知识。      顾名思义Record Management Syst

!Java 2509
上一篇: 今天你java了吗?
下一篇: java程序员测试——你了解J2ME平台嘛?
mingjava
博客等级 码龄24年 68粉丝 114原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址