一.代码 1.xml(1)activity_main.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_p…
一.代码 1.xml(1)activity_main.xml <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="发送Http请求" android:onClick="sendHttpRequest" /> <Button android:layout_width=&q…
前言 当你觉得你过得很舒服的时候,你肯定没有在进步.所以我想学习新的东西,然后选择了Tornado.因为我觉得Tornado更匹配目前的我的综合素质. Tornado学习笔记系列主要参考<introduction to Tornado>一书,网上有中文版,地址为 http://demo.pythoner.com/itt2zh/index.html 当然也参考了大量博客,在此鸣谢! 本系列不适合完全的0基础小白. 简介 Tornado全称Tornado Web Server,是一个用Python…
最近自己通过视频与相关书籍的学习,对action里面接收参数做一些总结与自己的理解. 0.0.接收参数的(主要)方法   使用Action的属性接收参数 使用DomainModel接收参数 使用ModelDriven接收参数 1.1.使用Action的属性接收参数 本文以最简单的表单提交为例: 1.1.1.建立login.jsp页面 <%@ page language="java" contentType="text/html; charset=UTF-8"…
Python的函数除了正常使用的必选参数外,还可以使用默认参数.可变参数和关键字参数. 默认参数 基本使用 默认参数就是可以给特定的参数设置一个默认值,调用函数时,有默认值得参数可以不进行赋值,如: def power(x, n=2): s=1 while n > 0: n = n - 1 s = s * x return s 这样调用power(5)时,相当于调用power(5, 2). 设置默认参数时的注意事项: 一是必选参数必须在前,默认参数在后,否则Python的解释器会报错: 二是如何…
子类不继承父类的构造方法,但父类的构造方法对子类构造方法的创建有影响.具体来说就是: ①.当父类没有无参构造方法时,子类也不能有无参构造方法:且必须在子类构造方法中显式以super(参数)的形式调用父类构造方法.否则会出现如下的错误: Implicit super constructor Person() is undefined for default constructor. Must define an explicit constructor 子类在有参构造方法中显式调用super(参数…
package p2; public class ParamterDemo { public static void main(String[] args) { int sum1 = add(4,5); int sum2 = add(4,5,6); int sum3 = add(4,5,6,7); System.out.println(sum1); System.out.println(sum2); System.out.println(sum3); } /* * 函数的可变参数. * 其实就是…
1.strings.xml <?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">S02_E01_SpinnerEtc</string> <string name="hello_world">Hello world!</string> <string na…
一.简介 二.代码1.xml(1)example_appwidget.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width=&qu…
一.代码流程 1.ExampleAppWidgetProvider的onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds),其中appWidgetIds表示widget的id, 在这个方法里,通过for遍历appWidgetIds,用PendingIntent和RemoteViews给widget的按钮绑定click事件,用appWidgetManager.updateAppWidget(a…