首页 文章 精选 留言 我的

精选列表

搜索[Swift开发],共10000篇文章
优秀的个人博客,低调大师

Python开发微信公众号后台(系列三)

之前有主流的小黄鸡机器人,但是没找到官方的网页版。(小黄鸡提供付费 API )尝试使用http://www.niurenqushi.com/app/simsimi/(虽然事实证明这个网站用的是图灵机器人的 API 而非小黄鸡 API ,后面我们会再谈 API 怎么用) 很简单的一个请求。 http://www.niurenqushi.com/app/simsimi/ajax.aspx?txt= 网址后面加上内容就可以了。 # -*- coding: utf-8 -*- import requests def talk(content): s = requests.session() r = s.post('http://www.niurenqushi.com/app/simsimi/ajax.aspx?txt

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

Python开发微信公众号后台(系列二)

2.3 文本消息操作小例——查快递 上一小节我们已经完成了对文本消息最基础的操作,但是原样返回内容,并没有做任何更多的操作,这一次我们来试试快递接口。 我使用的依然是前文中提到的文章中的 kuaidi100 查快递接口,不过我在本地测试了许多次通过但是 SAE 的服务器依然无法返回正常结果,在网上搜了很久发现时 快递100 封掉了来自 SAE IP 段的请求,也就是说那个接口不能用了,那段代码也废掉了。所以我们只能退而求其次,做一个通过快递单号判断快递公司的功能。 依然是修改weixinInterface.py def POST(self): str_xml = web.data() #获得post来的数据 xml = etree.fromstring(str_xml)#进行XML解析 msgType=xml

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

java支付宝开发-00-资源帖

一、一些重要的官方文档 1、沙箱登录 2、沙箱环境使用说明 3、如何使用沙箱环境 4、当面付产品介绍 5、扫码支付接入指引 6、当面付快速接入 7、当面付接入必读 8、当面付进阶功能 9、当面付异步通知 10、当面付SDK&DEMO 11、服务端SDK 12、生成RSA密钥 13、线上创建应用说明 14. 二、参考资料 1.支付宝app支付java后台流程、原理分析(含nei wang chuan tou)

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

JSP web应用程序开发教程实验二

版权声明:转载请注明出处:http://blog.csdn.net/dajitui2024 https://blog.csdn.net/dajitui2024/article/details/79396229 编码统一utf-8 文件名:e2alert.html <!DOCTYPE html> <html> <head> <meta http-equiv="Conten-Type" content="text/html; charset=UTF-8"> <title>登录失败</title> </head> <body> <h1 align="center"> 用户名或密码不正确!<br> 没有登录!无权访问本网站! </h1> <h1 align="center"><a href="e2login.html">请登录!</a></h1> </body> </html> 文件名:e2check_login.jsp <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Insert title here</title> </head> <body> <% String name=request.getParameter("username"); String password=request.getParameter("passwd"); if(name.equals("admin") && password.equals("123")) { session.setAttribute("username",name); response.sendRedirect("e2login_success.jsp"); } else { %> <jsp:forward page="e2alert.html"/> <% } %> </body> </html> 文件名:e2login.html <html> <body> <form method=post action="e2check_login.jsp"> <table align="center"> <tr> <td> 用户名: </td> <td> <input type=text name="username"> </td> </tr> <tr> <td> 密码: </td> <td> <input type=text name="passwd"> </td> </tr> <tr> <td colspan=2 align="center"> <input type=submit value="登录"> &nbsp;&nbsp;&nbsp;&nbsp; <input type=reset value="重设"> </td> </tr> </table> </body> </html> 文件名:e2login_success.jsp <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@include file="e2session_check.jsp" %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>登录成功</title> </head> <body> <br> <hr width=380> <center> <h1> <% out.print(sename); %> 登录成功 </h1> <h2> 欢迎您!<%=sename %> </h2> </center> </body> </html> 文件名:e2session_check.jsp <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Insert title here</title> </head> <body> <% String sename=(String)session.getAttribute("username"); if(sename==null || !sename.equals("admin")) { response.sendRedirect("e2alert.html"); } %> </body> </html>

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

JSP web应用程序开发教程实验一

版权声明:转载请注明出处:http://blog.csdn.net/dajitui2024 https://blog.csdn.net/dajitui2024/article/details/79396232 编码统一utf-8 文件名:a.jsp <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <html> <head> </head> <body> <% int num = Integer.parseInt(request.getParameter("num")); out.println(num+"的平方是:"+num*num); %> </body> </html> 文件名:b.jsp <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <html> <head> </head> <body> <jsp:include page="a.jsp"> <jsp:param value="19" name="num"/> </jsp:include> </body> </html> 文件名:ex201.jsp <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <html> <head> </head> <body> <% Date date = new Date(); int hour = date.getHours(); int minute = date.getMinutes(); int second = date.getSeconds(); if (hour >= 0 && hour < 12) { out.println("早上好!"); } else if (hour >= 12 && hour < 19) { out.println("下午好!"); } else { out.println("晚上好!"); } %> </body> </html> 文件名:test1.jsp <%@ page contentType="text/html;charset=utf-8" %> <% request.setCharacterEncoding("utf-8"); String strUserName = ""; strUserName = (String)request.getParameter("UserID"); if(strUserName.equals("张三")){ out.println("你好" + strUserName); }else{ out.println("名称错误"); } %> <br>姓名:<%=strUserName%><br> 文件名:test2.jsp <%@ page contentType="text/html;charset=utf-8" %> <html><body> <form action= " test1.jsp" method="post"> <p>姓名:<input type="text" size="20" name= "UserID"></p> <p><input type="submit" value="提 交"> </p> </form> </body></html>

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

Android开发学习笔记:数据存取之File浅析

Android系统中提供了一种文件读写的方法,可以将一些数据以文件的形式保存在设备中。比如一些word文档,PDF文档,图片,音频,视频文件等。 使用文件读写方法的步骤: 1.调用Context.openFileInput()方法获得Java文件输入流(FileInputStream) 2.调用Context.openFileOutput()方法获得java文件输出流(FileOutputStream) 3.使用Resources.openRawResource(R.raw.DataFile)方法返回InputStream 下面的具体实例,在一个Activity里面创建两个EditText和两个Button,第一个EditText和Button将EditText的内容写到文件file.txt文件中。第二个EditText和Button将内容从文件file.txt中读取出来显示。文件被默认保存在/data/data/package/files下面。 MainActivity.java packagecom.android.file; importjava.io.FileInputStream; importjava.io.FileOutputStream; importandroid.app.Activity; importandroid.os.Bundle; importandroid.view.View; importandroid.view.View.OnClickListener; importandroid.widget.Button; importandroid.widget.EditText; publicclassMainActivityextendsActivity{ //声明文件名字符串常量 privatestaticfinalStringFILE_NAME="file.txt"; privateButtonwriteBtn,readBtn; privateEditTextwriteText,readText; @Override publicvoidonCreate(BundlesavedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.main); writeBtn=(Button)findViewById(R.id.Button1); readBtn=(Button)findViewById(R.id.Button2); writeText=(EditText)findViewById(R.id.EditText1); readText=(EditText)findViewById(R.id.EditText2); writeBtn.setOnClickListener(newOnClickListener(){ @Override publicvoidonClick(Viewv){ //写内容 write(writeText.getText().toString()); } }); readBtn.setOnClickListener(newOnClickListener(){ @Override publicvoidonClick(Viewv){ //读内容 readText.setText(read()); } }); } privateStringread(){ try{ //实例化文件输入流对象 FileInputStreamfis=openFileInput(FILE_NAME); //定义缓存数组 byte[]buffer=newbyte[fis.available()]; //读到缓冲区 fis.read(buffer); returnnewString(buffer); }catch(Exceptione){ e.printStackTrace(); } returnnull; } privatevoidwrite(Stringcontent){ try{ //实例化文件输出流 //openFileOutput(Stringname,intmode) //第一个参数文件名 //第二个是模式 //MODE_APPEND表示要创建的文件存在则新写入的数据不会覆盖以前的数据。 FileOutputStreamfos=openFileOutput(FILE_NAME,MODE_APPEND); //写内容 fos.write(content.getBytes()); //关闭文件流 fos.close(); }catch(Exceptione){ e.printStackTrace(); } } } main.java <?xmlversion="1.0"encoding="utf-8"?> <LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="请被文本输入内容" /> <EditText android:text="" android:id="@+id/EditText1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:height="100px" /> <Button android:id="@+id/Button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="写数据" /> <EditText android:text="" android:id="@+id/EditText2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:height="100px" /> <Button android:id="@+id/Button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="读数据" /> </LinearLayout> 效果图: 在终端下输入“adb shell”命令进入Android系统查看一下我们的文件是否写入成功。 本文转自 lingdududu 51CTO博客,原文链接:http://blog.51cto.com/liangruijun/660540

资源下载

更多资源
优质分享App

优质分享App

近一个月的开发和优化,本站点的第一个app全新上线。该app采用极致压缩,本体才4.36MB。系统里面做了大量数据访问、缓存优化。方便用户在手机上查看文章。后续会推出HarmonyOS的适配版本。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Rocky Linux

Rocky Linux

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

用户登录
用户注册
修改密码
忘记密码