首页 文章 精选 留言 我的

精选列表

搜索[Web安全],共10000篇文章
优秀的个人博客,低调大师

Android程序猿搞Web 之HTML(二)

1、表格的使用 1)、基本使用 作用:显示数据<table width="500"></table>表示单元格的盒子; <body> <table width="500" border="1" align="center" cellpadding="10" cellspacing="0" > <caption>数字表格</caption> <tr> <th>数字</th> </tr> <tr> <td align="center">123</td> </tr> <tr> <td >123</td> </tr> </table> </body> caption:表示表格标题 tr:表示行 td:表示单元格 th:表示表头单元格,使得字体自动居中加粗 align:设置在网页中水平位置 cellpadding:设置表格内内容与边框之间的距离 单位:像素 cellspacing:设置单元格与单元格边框之间的距离 单位:像素 表格内无“列”的概念。 表格规范一般为 3参为0 样图 2)、合并单元格 rowspan:表示跨行合并 colspan:表示跨列合并 <body> <table width="500" border="1" align="center" cellpadding="10" cellspacing="0" > <caption>数字表格</caption> <thead> <tr> <th colspan="3">数字</th> </tr> </thead> <tbody> <tr> <td align="center" colspan="2">123</td> <td align="center">abs</td> </tr> <tr> <td rowspan="2">123</td> <td align="center">123</td> <td align="center">abs</td> </tr> <tr> <td align="center">123</td> <td align="center">abs</td> </tr> </tbody> </table> </body> 样图 2、表单 <body> <table width="600" border="0" cellspacing="5" cellpadding="0" align="center"> <caption><h4>揣着上坟的心情来上班</h4></caption> <tr> <td>所在地区</td> <td ><input type="text" value="帝都" maxlength="4"></td> </tr> <tr> <td>密码</td> <td ><input type="password" ></td> </tr> <tr> <td>性别</td> <td> 男<input type="radio" name="sex"> 女<input type="radio" name="sex"> 不确定<input type="radio" name="sex"> </td> </tr> <tr> <td>喜欢类型</td> <td> 小鲜肉<input type="checkbox" checked="true"> 老腊肉<input type="checkbox"> 半男不女<input type="checkbox"> </td> </tr> <tr> <td></td> <td> <input type="button" value="注册" > <input type="submit" value="提交" > <input type="reset" value="重置" > <input type="image" src="error.png"> </td> </tr> <tr> <td>上传头像</td> <td> <input type="file"> </td> </tr> </table> </body> 1)、input属性 type的值包含:text(单行文本输入框)、password(密码输入框)、radio(单选输入框)、checkbox(复选框)、button(普通按钮)、submit(提交按钮)、reset(重置按钮)、image(图像形式的提交按钮)、file(文件域); value:input控件中的默认文本; name:当input的type为radio时(单选框),则必须设置该属性,并且同一组内的name的值必须相同,才可实现单选的效果; size:input控件显示宽度 checked: 选择控件默认选中的项目,类似于radiobutton maxlength:控件允许输入的最大字数 样图 2)、label标签 <body> <label > 用户名:<input type="text"> </label> </body> 当点击用户名三个字的时候,光标即可直接在输入框内出现 样图 3)、文本域 <body> <textarea name="文本域" id="" cols="30" rows="10"></textarea> </body> 样图 cols:表示可输入列数 rows:表示可输入行数 3、下拉菜单 <body> <select name="" id="" > <option value="">北京</option> <option value="" selected="selected">天津</option> <option value="">上海</option> </select> </body> selected :表示默认选择该选项 样图 4、表单域 <body> <form action="wwww.baidu.com" method="get"> 用户名:<input type="text" name="username"> <br/> <br/> 密 码:<input type="password" name="password"> <br> <br> <input type="submit" value="提交" > <input type="reset" value="重置"> </form> </body> action 表示:表单域提交收集到的数据到服务器的 url 地址。 method :提交方式 get 和 post 等等 样图

优秀的个人博客,低调大师

python web开发之——Flask入门教程

一、安装python2.7(略) 1、Mac下使用python2.7 2、Windows下安装python2.7 从官网下载 双击python2.7,然后选择安装路径,一顿下一步就可以了。 设置环境变量,把python的安装路径添加到PATH变量中。 还需设置一个环境变量,将python的Script目录也添加到PATH中,一定要设置,不然后面就不能正常安装flask了。想学习可以加Python学习(q-u-n )-227-435-450 即可获取,内附:开发工具和安装包,以及视频资料系统学习路线图 二、安装python虚拟环境 1、为什么要安装虚拟环境,举个栗子: 假设你现在要开发一个项目A,使用的Flask的版本是0.12.2,过几年你又要开发一个项目B,但是这时候Flask的版本已经升级到1.0了,但其实Flask0.12.2版本和Flask1.0版本是不兼容的,怎么办呢?你不可能把Flask0.12.2版本卸掉重新安装吧,这样的项目A不是都不能用了? 我们安装python虚拟环境就是为了解决兼容性问题。虚拟环境会把项目A的0.12.2版本当做一个盒子,把项目Bde 1.0版本当做另一个盒子,每个盒子里安装包都不会有任何影响,这样两个版本就可以共存。 所以我们这里解释一下: 因为python的框架跟新迭代的太快,有时需要在电脑上存在一个框架多个版本,这时候虚拟环境可以解决这个问题。 2、安装虚拟环境 通过以下命令安装虚拟环境:pip install virtualenv 开辟新的虚拟环境:virtualenv [virtualenv-name] 激活虚拟环境: 【类linux】:source [虚拟环境的目录]/bin/activate 【windows】:直接进入到虚拟环境的目录,然后执行activate 退出虚拟环境:deactivate 详细步骤(已经会的可以略过): 1、打开cmd,输入 pipinstallvirtualenv 1 2、创建一个目录,将你的虚拟环境安装在这个目录,你可以任意选择。 比如我选择我电脑的F盘,目录名为Virtualenv 3、进入到我们刚创建的Virtualenv目录 4、然后我们用命令创建一个盒子(虚拟环境的名字假设叫FlaskHello) 安装好以后,进入FlaskHello的Script目录,激活虚拟环境 activate 1 看到途中箭头所指的Flask-env,说明虚拟环境就激活了。 退出虚拟环境使用命令 deactivate 1 三、安装Flask 1、进入到我们安装的虚拟环境中,执行 pipinstallflask 1 2、安装完以后,我们进入python,到入flask,然后查看flask的版本 注意:version左右是两个下划线。 四、第一个Flask程序 使用pycharm来创建一个工程。(项目名最好不要用中文) 这里Interpreter要注意,如果你的环境是在windows下,需要选虚拟环境下的python,这里选择Add local 比如我的 如果你是linux环境,那就在虚拟环境的bin下寻找。 2、创建完成后,会看到已经有模板了,我们设置编码方式为utf8 我们来执行一下这个模板,可以看到结果给我们一个地址,我们将其复制到浏览器访问,可以看到页面上输出了“Hello World” 程序解释:

优秀的个人博客,低调大师

Android平台调用Web Service:螺纹的引入

文字连接 剩下的问题 MainActivity的onCreate方法中假设没有有这段代码: // 强制在UI线程中操作 StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() .detectDiskReads().detectDiskWrites().detectNetwork() .penaltyLog().build()); StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder() .detectLeakedSqlLiteObjects().penaltyLog().penaltyDeath() .build()); 会报错误例如以下: FATAL EXCEPTION:main java.lang.NullPointerException atcom.example.demoservice.MainActivity.getRemoteInfo(MainActivity.java:91) atcom.example.demoservice.MainActivity$1.onClick(MainActivity.java:51) 这是由于android 3.0+以上 已经不建议在activity中加入耗时操作,要界面和数据脱离。4.0以上的通信都必须放到线程里去做,不能在UI线程。解决的方法是另起线程。假设一定要想在UI线程操作,就须要加入如上代码。 显然这样做是不可取的,由于通信消耗时间长,可能会让用户傻傻的等待。那么接下来就通过引入线程来解决问题。 通过Runnable接口和Thread类创建线程 我们能够用Runnable接口和Thread类创建线程。从而舍弃强制使用UI主线程的方式,代码例如以下(同一时候对代码进行了整理,把nameSpace等变量抽出来) public classMainActivity extends Activity { public static final String TAG ="webService_pj"; private EditText phoneSecEditText; private TextView resultView; private Button queryButton; @Override public void onCreate(BundlesavedInstanceState) { // StrictMode.setThreadPolicy(newStrictMode.ThreadPolicy.Builder() // .detectDiskReads().detectDiskWrites().detectNetwork() // .penaltyLog().build()); // // StrictMode.setVmPolicy(newStrictMode.VmPolicy.Builder() // .detectLeakedSqlLiteObjects().penaltyLog().penaltyDeath() // .build()); super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); phoneSecEditText = (EditText)findViewById(R.id.phone_sec); resultView = (TextView)findViewById(R.id.result_text); queryButton = (Button)findViewById(R.id.query_btn); queryButton.setOnClickListener(newOnClickListener() { @Override public void onClick(View v) { Log.i(TAG,"MainActivity线程ID:"+Thread.currentThread().getId()); // 手机号码(段) String phoneSec =phoneSecEditText.getText().toString().trim(); // 简单推断用户输入的手机号码(段)是否合法 if("".equals(phoneSec) || phoneSec.length() < 7) { // 给出错误提示 phoneSecEditText.setError("您输入的手机号码(段)有误!"); phoneSecEditText.requestFocus(); // 将显示查询结果的TextView清空 resultView.setText(""); return; } // 命名空间 String nameSpace = "http://WebXml.com.cn/"; // 调用的方法名称 String methodName ="getMobileCodeInfo"; // EndPoint String endPoint = "http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx"; // SOAP Action String soapAction = "http://WebXml.com.cn/getMobileCodeInfo"; // method params and values ArrayList<String> params= new ArrayList<String>(); ArrayList<Object> vals =new ArrayList<Object>(); params.add("mobileCode"); params.add("userId"); vals.add(phoneSec); vals.add(""); // 通过Runnable接口和Thread类 创建线程调用WebService newMyThread(nameSpace,methodName,endPoint,soapAction, params,vals).start(); //将WebService返回的结果显示在TextView中 resultView.setText(getResult()); } }); } //通过Runnable接口和Thread类,得到线程返回值 privateString result; publicString getResult(){ returnresult; } private class MyThread extends Thread { private String nameSpace; private String methodName; private String endPoint; private String soapAction; private ArrayList<String> params; private ArrayList<Object> vals; public MyThread(String nameSpace, String methodName, StringendPoint, String soapAction, ArrayList<String> params,ArrayList<Object> vals){ this.nameSpace = nameSpace; this.methodName = methodName; this.endPoint = endPoint; this.soapAction = soapAction; this.params = params; this.vals = vals; } @Override publicvoid run() { Log.i(TAG,"MyService线程ID:"+Thread.currentThread().getId()); result= getRemoteInfo(nameSpace, methodName, endPoint, soapAction,params,vals); } } /** *@MethodName : getRemoteInfo *@Description : 调用远程webservice方法 * @param nameSpace * @param methodName * @param endPoint * @param soapAction * @param params * @param vals * @return */ public String getRemoteInfo(StringnameSpace, String methodName, StringendPoint, String soapAction, ArrayList<String> params, ArrayList<Object>vals) { // 指定WebService的命名空间和调用的方法名 SoapObject rpc = newSoapObject(nameSpace, methodName); //设置需调用WebService接口须要传入的两个參数mobileCode、userId for (int i = 0; i < params.size();i++) { rpc.addProperty(params.get(i),vals.get(i)); } //生成调用WebService方法的SOAP请求信息,并指定SOAP的版本号 SoapSerializationEnvelope envelope =new SoapSerializationEnvelope(SoapEnvelope.VER10); envelope.bodyOut = rpc; // 设置是否调用的是dotNet开发的WebService // envelope.dotNet = true; // 等价于envelope.bodyOut = rpc; envelope.setOutputSoapObject(rpc); HttpTransportSE transport = newHttpTransportSE(endPoint); try { // 调用WebService transport.call(soapAction,envelope); } catch (Exception e) { e.printStackTrace(); } // 获取返回的数据 SoapObject object = (SoapObject)envelope.bodyIn; String result = ""; if (object != null) { // 获取返回的结果 result =object.getProperty(0).toString(); } return result; } } 通过线程进行通信。得到相同结果 出现新的问题 能够发现,运行线程中须要在线程中返回一个值,通过在run()中保存返回值。存储返回值的变量应该是MainActivity的成员变量。然后在主线程中用一个get方法取得该值。 可是run何时完毕是未知的。非常可能当第一次点击button后。依旧看不到结果,直到第二次或者很多其它才看到,所以我们须要一定的机制来保证。 而在Java se5就開始用Callable和Future来管理多线程了。能够解决问题。接下文。。 。 源代码下载 http://download.csdn.net/detail/tcl_6666/7365341 版权声明:本文博客原创文章,博客,未经同意,不得转载。 本文转自mfrbuaa博客园博客,原文链接:http://www.cnblogs.com/mfrbuaa/p/4732231.html,如需转载请自行联系原作者

优秀的个人博客,低调大师

使用Dockerfile构建镜像-Docker for Web Developers(5)

1.理解Dockerfile语法 语法命令 命令功能 举例 FROM 所有的dockerfile都必须以FROM命令指定镜像基于哪个基础镜像来制作 FROM ubuntu:14:04 MAINTAINER 该容器维护作者,一般是作者的电子邮件 MAINTAINERliminjun2007@gmail.com RUN 在shell或者exec的环境下执行的命令,run指令会在新创建的镜像添加新的层面,接下来提交的结果用在dockerfile的下一条指令中。 RUN echo "Hello World" > /root/hello_world.txt CMD 提供容器默认的执行命令,dockerfile只允许使用一次CMD命令,如果执行多次,最后一次自动替换之前的。 CMD ["cat", "/root/hello_world.txt"] 更多详细语法可以参考:Dockerfile语法 2.编写一个简单的Dockerfile #FROM - Image to start building on. FROM ubuntu:14.04 #MAINTAINER - Identifies the maintainer of the dockerfile. MAINTAINER liminjun2007@gmail.com #RUN - Runs a command in the container RUN echo "Hello World" > /root/hello_world.txt #CMD - Identifies the command that should be used by default when running the image as a container. CMD ["cat", "/root/hello_world.txt"] Dockerfile文件放到simple-dockerfile文件夹下面,切换到simple-dockerfile文件夹下,执行命令: docker build -t simple . 运行结果如下图所示: 运行simple容器,执行命令之后运行结果如下: root@ubuntu-512mb-sfo2-01-gfw:~/simple-dockerfile# docker run simple Hello world 3.参考链接 Dockerfile语法 Dockerfile 最佳实践 Dockerfile 构建镜像 - 每天5分钟玩转容器技术(13) 本文转自快乐八哥博客园博客,原文链接http://www.cnblogs.com/liminjun88/p/using-dockerfile-to-build-docker-image.html如需转载请自行联系原作者 快乐八哥

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册