【转】symbian s60 3rd 横屏竖屏切换、旋转屏幕,全屏

塞班手机 八门神器1.72 s60v3v5 S^3版 塞班手机上的软件,八门神器,多的也不说了,知道的可定知道,破解,汉化,两款,支持 s60v3v5 S^3版 立即下载

symbian s60 3rd 横屏竖屏切换

 

原文:http://blog.sina.com.cn/s/blog_491e04500100dg85.html

 

设备, 软件 版本:

S60 3rd Edition

S60 3rd Edition, FP1

S60 3rd Edition, FP2

详细描述:

缺省情况下,程序是根据手机屏幕的当前方向开始启动的。如果要强制程序以横屏或竖屏的模式启动,那我们在CAknAppUi::ConstructL()方法中调用BaseConstructL()时就要传递相应的flag值:

定义如下:

        EAknEnableSkin = EAknEnableSkinFlag,
        EAppOrientationPortrait     = EAppOrientationSpecifiedFlag,
        EAppOrientationLandscape    = EAppOrientationSpecifiedFlag
                                      | EAppOrientationLandscapeFlag,
        EAppOrientationAutomatic    = EAppOrientationSpecifiedFlag
                                      | EAppOrientationAutomaticFlag,
        // Since 3.0
        EAknDisableHighlightAnimation = EAknDisableHighlightAnimationFlag,

使用方式:

void CMyAppUi::ConstructL()

{

BaseConstructL( EAknEnableSkin | EAppOrientationLandscape ); // start in landscape mode

...

}

如果要在程序运行期间改变方向,则需要调用:
void CAknAppUiBase::SetOrientationL( TAppUiOrientation aOrientation );
例:在HandleCommandL(TInt aCommand)函数中:

        case ES60ExCmdRotate:
         {
         iForcedRotateState = ETrue;
     
       if( !ScreenState() )
            {
            SetOrientationL(CAknViewAppUi::EAppUiOrientationPortrait); //竖屏         
            }
          else
            {        
            SetOrientationL(CAknViewAppUi::EAppUiOrientationLandscape); //横屏    
            }         
         break;
            }
这里的参数为EAppUiOrientationLandscape和EAppUiOrientationPortrait,注意这种情况下的调用就不要再向BaseConstructL()中传递相同的参数了。

注意

  • 横屏(landscape),前者是横幅,一般多用在风景照,所以叫"landscape"。
  • 竖屏(portrait),后者是直幅,一般多用在肖像上,所以叫"portrait"。

实例代码:S60_Platform_Custom_UI_and_Screen_Rotation_Example_v1_0_en.zip

 

测试机型:nokia 5320 xpressmusic

不过在3rd mr模拟器上测试屏幕旋转没效果,这个模拟器不支持旋转,只能手动设置屏幕大小。屏幕旋转需要真机测试。

 

旋转屏幕
2.8,3.0 SDK支持屏幕旋转,程序里面可以捕获该消息,然而使UI自定义的改变位置
继承的函数为:Container::HandleResourceChange,原先的SizeChange这个函数不会响应
 
在该函数内不要使用AppUi->ClientRect函数来获取工作区范围,数据会有偏差(这个问题郁闷了好久),可以使用
TRect rect;
AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane,rect );
来获取RECT

 

彻底解决Symbian全屏显示问题

原文:http://blog.youkuaiyun.com/Max__Payne/archive/2009/02/18/3906734.aspx

 

最近总有同行问我Symbian全屏显示的问题,说是参考了网上的方法也无法设置成全屏。其实,归根结底还是不明白Symbian框架的调用机制。这篇文章里我就来彻底研究一下Symbian全屏的机制。

首先,我们可以利用Carbide.vs向导建一个项目,名字就叫"TestScreen",选择基于Eikon的传统控件架构。

那么在CTestScreenAppUi的二阶构造函数里就有如下代码:

void CTestScreenAppUi::ConstructL()

{

BaseConstructL();

iAppContainer = new (ELeave) CTestScreenContainer;

iAppContainer->SetMopParent( this );

iAppContainer->ConstructL( ClientRect() );

AddToStackL(iAppContainer);

}

这里面有很关键的一句,就是我用红色显示的那 段代码。它把当前UI的ClientRect()传递给Container类,我们都知道Container类是控件类,负责整个程序的界面显示,那么 UI传递给Container的这个ClientRect()到底是什么东东呢?我们看看SDK HELP:

ClientRect()

TRect ClientRect() const;

Description

Gets the area of the screen available to the application for drawing, not including the space that is available for any of the following, where required: non-application areas which should always be displayed, an application status pane, an application button group, an application menu bar, an application title band and an application tool bar.

Importantly, the co-ordinates of the rectangle are relative to the whole screen area so, for example, the co-ordinate for the top, left point of the area available for drawing may be (0, 45).

Return value

TRect The area of the screen available to the application for drawing.

从Description我们可以看 到:ClientRect()获得应用程序绘制的有效屏幕区域,但是这个区域不包括那些总是显示的非应用程序区域,比如:应用程序状态面板 (application status pane)、按钮(button group)、应用程序的菜单bar、标题、工具条。

而且更重要的是从下面一行可以看出,这个ClientRect()所获得区域的top-left坐标是(0,45)。

通过上面的分析我们知道,UI在构造我们的Container时传递一个所谓的"客户矩形区域",这个"客户矩形区域"的top-left坐标是(0,45),从而也就知道如果要让我们的程序全屏显示,那么我们需要改变的是构造Container的时候传递的矩形大小。

那么就有如下几种方法:

①如果我们知道屏幕尺寸,那么就可以把iAppContainer->ConstructL( );里面的参数改为TRect (0,0,176,208)。

②上面的程序不具有适配性,因为我们把屏幕的宽度和高度写死了。

我们来看Symbian给我们提供的一个方法

ApplicationRect()

TRect ApplicationRect() const;

Description

Gets the total area of the screen available to the application. This includes the space that is available for a toolbar, toolband or title band, if the application requires them.

Return value

TRect The total area of the screen available to the application.

Description写的很明显了,我就不翻译了。这个方法可以获得屏幕的整个尺寸,我们把程序可以改为:

iAppContainer->ConstructL( ApplicationRect() );从而实现程序的全屏显示。

③第三中方法是最笨的方法了,那就是不改变UI所传递的"客户矩形区域"的大小,传递的仍然是ClientRect()。但是到了Container后再采用"亡羊补牢"的做法!把status pane、menu bar等隐藏起来。

而且这种方法也容易出错误,下面是一个同行犯的错误,他在Container类里写入下面代码:

void CTestScreenContainer::ConstructL(const TRect& aRect)

{

CreateWindowL();

iLabel = new (ELeave) CEikLabel;

iLabel->SetContainerWindowL( *this );

iLabel->SetTextL( _L("Example View") );

iToDoLabel = new (ELeave) CEikLabel;

iToDoLabel->SetContainerWindowL( *this );

iToDoLabel->SetTextL( _L("Add Your controls/n here") );

SetRect(aRect);

CEikStatusPane* statusp = iEikonEnv->AppUiFactory()->StatusPane();

if(statusp)

statusp->MakeVisible(EFalse);

iEikonEnv->AppUiFactory()->Cba()->MakeVisible(EFalse);

ActivateL();

}

为了使用CEikStatusPane类要加入头文件#include

为了使用CEikButtonGroupContainer类要加入头文件#include

其中iEikonEnv->AppUiFactory()是在Symbian中获取UI实例常用的方法,这和MFC是一样,你千万不能new一个CTestScreenAppUi出来,因为他们是由框架调用的,我们并不知道何时调用。

但是因为他是在Container类里调用这两个方法,也就是说ClientRect()获取"矩形区域"之后程序才设置status pane、Cba为不可见!所以当然也没什么用,程序仍然无法全屏显示。

所以说即使你在UI类里写下面的代码,但因为代码是在获取"矩形区域"之后才设置status pane、Cba为不可见,程序仍然无法全屏显示!

void CTestScreenAppUi::ConstructL()

{

BaseConstructL();

iAppContainer = new (ELeave) CTestScreenContainer;

iAppContainer->SetMopParent( this );

iAppContainer->ConstructL( ClientRect() );

//在获取"矩形区域"后设置status pane、Cba为不见

CEikStatusPane* statusp = StatusPane();

if(statusp)

statusp->MakeVisible(EFalse);

Cba()->MakeVisible(EFalse);

AddToStackL( iAppContainer );

}

所以千万记住:如果要通过设置status pane、Cba为不可见的方法获得全屏,千万要在获取"矩形区域"之前设置!

④上面集中方法都是通过在UI类设置"矩形区域"的大小,或者通过设置status pane、Cba不可见隐式改变"矩形区域"的大小实现全屏的。

这里我们介绍一种在Container类里,在UI设置完"矩形区域"后再改变屏幕为全屏显示的方法。void CTestScreenContainer::ConstructL(const TRect& aRect)

{

CreateWindowL();

iLabel = new (ELeave) CEikLabel;

iLabel->SetContainerWindowL( *this );

iLabel->SetTextL( _L("Example View") );

iToDoLabel = new (ELeave) CEikLabel;

iToDoLabel->SetContainerWindowL( *this );

iToDoLabel->SetTextL( _L("Add Your controls/n here") );

SetRect(aRect);

SetExtentToWholeScreen();

ActivateL();

}

但是要千万记 得:SetExtentToWholeScreen()一定要在SetRect(aRect)之后调用才有效果。这点很容易理解,因为如果 SetExtentToWholeScreen()改变屏幕为全屏后,再调用SetRect(aRect)又把屏幕尺寸设置为UI里传递的"矩形区域"的 大小了。

 

Dialog全屏实现:

RESOURCE DIALOG r_dialog_waitingbox0
{
    flags = EEikDialogFlagWait
            |EEikDialogFlagFillAppClientRect //client screen
            |EEikDialogFlagNoShadow
            |EEikDialogFlagNoBorder
            |EEikDialogFlagCbaButtons
            |EEikDialogFlagNotifyEsc  //OkToExitL will catch "exit" event
            |EEikDialogFlagNoDrag;
    buttons = R_AVKON_SOFTKEYS_CANCEL;
}
void CUbWaitingBox::PostLayoutDynInitL()
{
#if 1 //dialog 全屏的实现
    // hide cba buttons
    CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
    cba->MakeVisible(EFalse);
    // hide status pane
    CEikStatusPaneBase* statusPane = CEikStatusPane::Current();
    statusPane->MakeVisible(EFalse);
    SetExtentToWholeScreen();
#endif
    CAknDialog::PostLayoutDynInitL();
}

 

屏幕相关事件:

void CAknAppUi::HandleResourceChangeL( TInt aType );

void CAknAppUi::HandleScreenDeviceChangedL();

void CAknAppUi::HandleForegroundEventL(TBool aForeground);

例如捕捉转屏事件:

在appui的HandleResourceChangeL处理
HandleResourceChangeL( TInt aType )
{
CAknAppUi::HandleResourceChangeL( aType );
if ( aType==KEikDynamicLayoutVariantSwitch ) {
//TODO: handle screen switch
}
}

void CUbiLiveGC_SymbianAppUi::HandleForegroundEventL(TBool aForeground)
{
    TAppUiOrientation aOrientation = Orientation();
    if(aOrientation==EAppUiOrientationLandscape){
       
    }
}
void CUbiLiveGC_SymbianAppUi::HandleScreenDeviceChangedL()
{
    TAppUiOrientation aOrientation = Orientation();
    if(aOrientation==EAppUiOrientationLandscape){
       
    }
}

塞班软件直签工具s60sign_ss.v121.s60v3v5.b20110203 塞班软件直签工具s60sign_ss.v121.s60v3v5.b20110203 手机没有证书,又不会刷机,心仪的软件安装不了,试试用它。 立即下载

相关推荐

塞班v3/v5的多用软件 供py编程者学习

须安装py平台,想提取源代码可以用sis编辑器解包。。

symbian s60 3rd 横屏竖屏切换

设备, 软件 版本: S60 3rd Edition S60 3rd Edition, FP1 S60 3rd Edition, FP2 详细描述: 缺省情况下,程序是根据手机屏幕的当前方向开始启动的。如果要强制程序以横屏或竖屏的模式启动,那我们在CAknAppUi::ConstructL()方法中调用BaseConstructL()时就要传递相应的flag值: 定义如下: EAknEnableSkin = EAknEnableSkinFlag,

striker的专栏 825

横屏软件_signed.sisx

5800 一键横屏 不用开启重力,固定横屏,自己感觉还是很好用的,尤其是在玩一些横屏游戏时

Symbian 强制横屏、竖屏

<br /><br /> 在appui里的ConstructL中使用:<br /> //强制使用竖屏<br /> CAknAppUiBase::SetOrientationL(EAppUiOrientationPortrait);<br /> //切换为横屏<br /> CAknAppUiBase::SetOrientationL(EAppUiOrientationLandscape);

think12的专栏 1166

深入解析SDC时钟约束:从create_clock到set_clock_groups的实战指南

本文深入解析SDC时钟约束,从create_clock到set_clock_groups的实战应用,帮助数字芯片设计工程师掌握时序约束的核心技巧。通过详细讲解时钟三要素(波形定义、不确定性和时钟关系)及实战案例,提升时钟约束的精准性和效率,避免常见设计陷阱。

weixin_29274337的博客 1077

TMS320F280049C 学习笔记21 交叉开关 Crossbar (X-BAR)

简单介绍了X-BAR。

whyorwhnt的专栏 2万+

uniapp支持App横竖屏开发总结

app要支持重力感应自动切换横竖屏,并切换后样式不能错乱

Funky_oaNiu的博客 1440

python sci sci-hub 爬论文

sci-hub 爬虫 后续加入对于时间的排序,下载最新文献 参考: https://www.guanjihuan.com/archives/6846 https://blog.youkuaiyun.com/czh2637750821/article/details/115508922

weixin_42783619的博客 3541

在Qt应用中强制使用横屏或竖屏

在Qt应用中强制使用横屏或竖屏 From Forum Nokia Wiki 摘要:本文介绍怎么在Qt for Symbian程序中即使手机水平状态发生变化的时候强制使用横屏或竖屏。 对于带有水平传感器的Symbian手机,在用户将手机从横屏模式(Landscape)切换到竖屏模式(Portrait)时,系统会自动调整手机的屏幕显示方向,满足用户正常的使用需要。屏幕横宽比的变化,需要应用...

syoukenn 1027

Modelsim安装教程以及管理员身份运行patch_dll.bat时找不到文件mgls.dll的解决

Modesim安装教程 Modesim版本有很多,但是安装方式大都相同,我们以modesim.10.5为例,电脑使用的是win10 64位,讲一下安装过程中的步骤以及出现问题的解决方法 一 安装 1.首先解压安装包,在解压的安装包内选择应用程序,右键选择管理员运行。 2.稍等一会,有的电脑会弹出是否允许modesim进行更改,选择 是 即可,然后出现下面的界面,点击下一步。 3.弹出此界面选择安装路径,选择安装路径,我是在D盘新建的文件夹,直接把文件夹中的路径复制在框内。文件夹名称切记不要带中文 4.

weixin_48564372的博客 1万+

基于STM32F103C8T6的循迹避障小车完整制作过程(详细)----上篇(第123点)

基于STM32F103C8T6的循迹避障小车完整制作过程 由于本人的一个小项目,要做一个基于STM32的循迹避障小车,前后花了约1周的时间,这个过程种也参考了很多大神分享的资料,学到很多的东西。但是资料都比较分散,有些东西也不好找,在这里就想把自己制作小车的一个整体过程记录分享一下,希望能够帮到你。 我自己也算是一个小白,之前有做过 你好! 这是你第一次使用 Markdown编辑器 所展示的欢迎...

weixin_43924857的博客 14万+

APP 横屏和竖屏

普通情况下,APP 随着用户拿手机是横向还是竖向,自动翻转 -- 当然,这个也需要用户设置手机的屏幕是否跟随手机的物理方向而翻转。但如果我们的APP,在某种情况下,必须以竖屏方式显示,在某种情况下,必须以横屏方式显示,不管用户是否把手机横过来放。该怎么办?网上搜了一堆东西出来。安卓的资料比较多一点,iOS 的就很少了。最终解决了这个问题。大概代码如下:uses {$IFDEF IOS}iOSapi...

pcplayer的博客 6177

串口通信的性能瓶颈分析:如何提高数据吞吐量和降低延迟

摘要: 串口通信在高频或大数据场景下存在吞吐量不足、延迟高、丢帧等问题,主要瓶颈包括波特率限制、缓冲区不足、CPU轮询延迟等。优化策略包括:提升波特率至硬件上限、增大缓冲区、采用异步I/O(如ReadAsync)减少线程切换,使用二进制协议降低解析开销。实时性方面需启用硬件流控、批量发送数据,并优化线程优先级。跨平台适配需区分Windows/Linux的缓冲区设置与异步机制。性能测试可通过吞吐量、延迟及回环测试验证优化效果,核心原则是硬件匹配、异步处理、协议优化与跨平台适配。(150字)

这里只有干货:从 Modbus 通信到 MES 对接,从 YOLO 训练到工控机部署,带你搞定工业软件开发全流程。 979

如何强制App横屏或者竖屏显示应用

  最近开发应用的时候遇到一个需求,就是使用应用的时候需要强制横屏显示,本以为是一个非常简单的需要,可是真正在使用的时候却遇到了麻烦。我的应用是一个Activity+多个Fragment来实现的,遇到的问题是我的Fragment里面嵌套有视频播放,我是用的是饺子播放器(需求不高,只要能简单的播放一下视频就可以了,哪位伙伴有其他好用的视频播放器也可以留言推荐一下,谢谢),其他的时候设置了androi...

从事移动开发八年,csdn博客专家,阿里云特邀专家,华为云云享专家,高级网络信息安全工程师,大数据工程师(高级),python技术开发(高级),HarmonyOS 应用开发者高级认证,现在某学校任教。 1万+

渗透测试面试题

渗透测试面试题 一.思路流程 1.信息收集 服务器的相关信息(真实ip,系统类型,版本,开放端口,WAF等) 网站指纹识别(包括,cms,cdn,证书等),dns记录 whois信息,姓名,备案,邮箱,电话反查(邮箱丢社工库,社工准备等) 子域名收集,旁站,C段等 google hacking针对化搜索,pdf文件,中间件版本,弱口令扫描等 扫描网站目录结构,爆后台,网站banner,测试文件,...

千寻的博客 12万+

JMeter压力测试全攻略:从入门到精通

本文系统讲解JMeter压力测试的完整流程与结果评估方法。开篇介绍压力测试的核心概念及JMeter工具特性,随后从环境搭建入手,详细说明JDK配置、JMeter安装及中文界面设置。主体部分围绕测试流程展开,涵盖测试计划创建、线程组参数调优、HTTP请求配置、断言与监听器添加等实操步骤;结果评估环节深入解析聚合报告指标、结果树分析及性能瓶颈定位方法,并通过电商接口测试案例演示全流程应用。文末总结关键要点,为读者提供从基础操作到分布式压测、性能调优的进阶学习方向,助力掌握JMeter在系统性能评估中的核心应用。

邓邓子的博客 2414

用代码 强制设置横屏或竖屏 设置全屏

全屏 在Activity的onCreate方法中的setContentView(myview)调用之前添加下面代码 requestWindowFeature(Window.FEATURE_NO_TITLE);//隐藏标题 getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,   Wi

月神的专栏 3083

深度学习工具包 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&#39;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(&#39;DeepLearnToolbox&#39;));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(&#39;state&#39;,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&#39;); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand(&#39;state&#39;,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 = &#39;sigm&#39;;%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, &#39;Too big error&#39;);```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(&#39;state&#39;,0)sae = saesetup([784 100]);sae.ae{1}.activation_function = &#39;sigm&#39;;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)&#39;)% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;;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, &#39;Too big error&#39;);```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x&#39;,28,28,60000))/255;test_x = double(reshape(test_x&#39;,28,28,10000))/255;train_y = double(train_y&#39;);test_y = double(test_y&#39;);%% 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&#39;ll get around 1.2% errorrand(&#39;state&#39;,0)cnn.layers = { struct(&#39;type&#39;, &#39;i&#39;) %input layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 6, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %sub sampling layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 12, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 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, &#39;Too big error&#39;);```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(&#39;state&#39;,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, &#39;Too big error&#39;);%% ex2 neural net with L2 weight decayrand(&#39;state&#39;,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, &#39;Too big error&#39;);%% ex3 neural net with dropoutrand(&#39;state&#39;,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, &#39;Too big error&#39;);%% ex4 neural net with sigmoid activation functionrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;; % 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, &#39;Too big error&#39;);%% ex5 plotting functionalityrand(&#39;state&#39;,0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = &#39;softmax&#39;; % 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, &#39;Too big error&#39;);%% 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(&#39;state&#39;,0)nn = nnsetup([784 20 10]); nn.output = &#39;softmax&#39;; % 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, &#39;Too big error&#39;);```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Hbuilder MUI 锁定和解除锁定屏幕方向

锁定屏幕方向 plus.screen.lockOrientation( String orientation ); 说明: 锁定屏幕方向后屏幕只能按锁定的屏幕方向显示,关闭当前页面后仍然有效。 可再次调用此方法修改屏幕锁定方向或调用unlockOrientation()方法恢复到应用的默认值。 plus.screen.lockOrientation('landscape-primary'...

weixin_42340514的博客 6249

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

iOS 全横屏app设置

iOS app 全横屏

huang413的专栏 6779

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

使程序一运行就横屏的方法

在Info.plist里面加 initial interface orientation 值给: Landscape(right home button)

Abbott 943

Android设置activity横屏

Android设置activity横屏 首先说明,设置横屏只能对于activity设置,要想对整个application有效的话,就在每个activity中都设置上横屏吧。 设置横屏方法有二: 一、Manifest文件中设置 在activity中加入标签 android:screenOrientation="landscape" android:screenOrientation="sensorLandscape" landscape可设置该activity强制横屏,只有一个方向,不会根据手

only95 8858

Qt for Symbian怎样强制使用横屏或竖屏

<br />摘要:本文介绍怎么在Qt for Symbian程序中即使手机水平状态发生变化的时候强制使用横屏或竖屏。 <br />对于带有水平传感器的Symbian手机,在用户将手机从横屏模式(Landscape)切换到竖屏模式(Portrait)时,系统会自 动调整手机的屏幕显示方向,满足用户正常的使用需要。屏幕横宽比的变化,需要应用调整窗口的布局,以保证更好的用户体验。 <br />但是在某些特殊场合中(比如游戏),开发者可能希望即使手机的水平状态已经变化,需要屏幕继续保持原来的屏幕方向,提示用户

sanfengshou的专栏 771

昨日皇者——Symbian(塞班)

1)Symbian作为昔日智能手机的王者,在2005年至2010年曾一度风骚,街上大大小小拿的很多都是诺基亚的Symbian手机,N70——N73——N78——N97,诺基亚N系列曾经被称为“N=无限大”的手机。对硬件的水平底,操作简单,省电,软件资多是Symbian系统手机的重要特点。2)在国内软件开发市场内,基本每一个软件都会有对应的塞班手机版本。而塞班开发之初的目标是要保证在较低资源的设备上...

qq_25276105的博客 844

activity强制设置为横屏

在AndroidManifest.xml 对应的acticity中添加属性android:screenOrientation="landscape"

u010992774的博客 398
上一篇: Windows Mobile 窗口全屏
下一篇: 【转】Symbian 中各种提示、输入对话框的使用
code09
博客等级 码龄18年 31粉丝 56原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值