安卓触屏进行的图形变换--平移,缩放核心代码 平移核心代码...//单指针起始位置////MotionEvent.ACTION_DOWN,第一个指针float originalx = motionevent.getX(index);float originaly = motionevent.getX(index);...private void handleTranslate(MotionEvent ev){ fina
二叉树推导 3 二叉树的推导3.1 由前序中序推导已知一棵二叉树的前序序列和中序序列,构造该二叉树的过程如下:Ø 根据前序序列的第一个元素建立根结点;Ø 在中序序列中找到该元素,确定根结点的左右子树的中序序列;Ø 在前序序列中确定左右子树的前序序列;Ø 由左子树的前序序列和中序序列建立左子树;Ø 由右子树的前序序列和中序序列建立右子树。3.2 由中序后序推导已知一棵二叉树的后序序列和中序序列,构造该二
ionic v1 添加点击展开/收缩功能 类似QQ的收缩列表,利用ionic1来实现其实很简单 假设我们要在通过点击一个图标来作为触发的点击这里展开/收缩我们给这个图标添加一个点击事件,如:通过利用ng-show来控制
ionic无法下载'https://jcenter.bintray.com/com/android/tools/build/gradle/x.x.x/gradle-x.x.x.pom 作为中国开发者,你必须要知道有一堵墙,名为GFW。在这时,有时你需要加载网络资源的程序就会莫名奇妙被阻断,这不一定是程序bug,而有可能时网络问题。比如当ionice需要加载资源时无奈正好被肛上了: What went wrong: A problem occurred configuring root project ‘helloworld’. Could not resolve
Error: Android SDK not found. Make sure that it is installed. If it is not at the default location, 自从升级android studio2.3.1后,运行ionic项目时无法再在android平台上启动。网上查了很多信息后,得知是android sdk废弃android命令,以及改变了目录结构。
Rxjs基础 Observable:对可调用的将来value或event集合的做法 Observer:是一个回调函数集合,知道怎么监听来自Observable发送的值 Subscription:代表一个Observable的执行,最基本用涂是取消执行 Subject:事件发出者,可以传递一个value或event到observer Observables are lazy Push collections
Angular2(九)--http Angular http.get returns an RxJS Observable The AngularObservable is a bare-bones implementation. In the promise’s then callback we call the json method of the HTTP Response to extract the data
Angular2(八)--module化(核心模块与共享模块) Ahead-Of-time (AoT) 在main.ts可以设置AppModuleNgFactory(The app module factory produced by the static offline compiler)(main.ts)// The app module factory produced by the static offline compilerimport {
Angular2(七)--Hierarchical dependence injection export class EditItem<T> { editing: boolean; constructor (public item: T) {}}define an API to set a value of any type which can be altered, retrieved or set back to its initial value:https://angul
Angular2(六)--单一实例(singleton)示例 to have only one singleton in the entire application, disregarding if our modules are being loaded at bootstrap or lazy loaded单一实例:import { NgModule, ModuleWithProviders } from '@angular/core';/* ...
Angular2(五)--router 使用angular声明周期方法,避免在constructor进行太多的工作,只需在constructor中创建和声明变量即可在ngModel的import中导入我们的router,RouterModule.forRoot() 路径可以是相对和绝对路径,“:id”这样的表示代表route参数id。data属性是与指定router关联的参数数据,对活动的router可见,空路径是默认路径,router
Angular2(四)--promise angular生命周期方法: 每个方法名称是在该接口名加前缀ng 使用angular生命周期需要实现相应的接口,才能使用其生命周期方法Promise异步技术使用then()方法注册,异常处理使用catch()方法 创建一个Promise对象:const p = new Promise( function (resolve, reject) { // (A) ···
Angular2(三)--依赖注入 provider提供具体运行时的依赖值版本使用service的Injector步骤: 1.新建一个service文件用来关联数据,通过@Injectable()注释该类成为一个Injector@Injectable()export class HeroService {getHeroes() { return HEROES; }}2.在component或module中配置provider来
Angular2(二)--属性绑定 *ngFor用来显示数组[(ngModel)]=“”用来显示双向绑定数据,{{}}用来显示单项绑定数据,为了使用双向绑定的form inputs,我们需要导入FormsModule模块,来导入包含ngModel的表单包angular绑定事件从$event中获取用户的输入,$event.target给我们一个HTMLInputElement,有一个value属性包含用户的输入数据 template
Angular2(一)--模块 modules : angular.module('myModule', [])表示创建一个新的myModule模块;angular.module('myModule')表示取回一个已存在的myModule模块。前者的中括号是数组,是所需的依赖模块,在使用前被加载,类似run block。 composing HTML templates with Angularized markup, wri
javaweb 过滤器和监听器总结 过滤器在3.0中使用标注声明一个过滤器:@WebFilter(filterName = "EncodingFilter", urlPatterns="/*", initParams=@WebInitParam(name="charset",value="UTF-8"))这是一个简单的编码过滤器范例,使用了常用的三个属性,指定过滤器名(filterName),过滤器应用
web开发使用Javabean 1.JavaBean简介javabean类:private修饰属性,提供public修饰的访问方法(setter和getter)组成2.使用JavaBean使用<jsp:useBean>指令导入javabean,格式: <jsp:useBean id="实例化对象名称“ scope="保存范围” class="包.类名称“/> 即可使用id对象调用类中属性和方法。向javaBean设置属性,格式
servlet跳转 客户端跳转只能传递session及application范围的属性,而无法传递request范围的属性@WebServlet(name="clientRedirect",urlPatterns = "/ClientRedirectDemo")public class ClientRedirectDemo extends HttpServlet { @Override protect
Servlet3.0及以上如何重写@WebServlet映射 @WebServlet简介@WebServlet标注允许servlet映射声明在servlet代码,作用同通过映射部署描述符(web.xml)文件的servlet.简单示例:package com.test.z;import java.io.IOException;import java.io.PrintWriter;import javax.servlet.ServletException;
Missing Operating System问题检查及恢复 Missing Operating System问题检查及恢复步骤: 英文原文:https://www.partitionwizard.com/partitionmagic/missing-operating-system.html中文简要步骤:(按顺序进行)1.找到你电脑进入BIOS的快捷键:f1/f2等尝试2.检查硬盘驱动是否能被BIOS检测到:如图。(这是最基本的需求)如果检测不到,那接下进