- 博客(42)
- 收藏
- 关注
转载 Django 实例介绍 - Pycharm
1. 创建工程Location: 项目路径Application name: 应用名称2. 项目目录视图demosite 包含项目的文件夹manage.py 命令工具,用于管理Django项目内嵌demosite python包demosite/settings.py Django项目的配置文件demosite/urls.py Django项目路由demosite...
2017-11-08 22:40:00
202
转载 ChatterBot - 05 Input Adapters 输入适配器
输入适配器的作用就是从给定的数据源读取数据,并将其转化为机器人能够识别的格式。1. 变量输入类适配器chatterbot.input.VariableInputTypeAdapter (***kwargs*)这个适配器可以接受几种不同类型的输入变量:json、text、object,或者可以说成是:strings、dictionaries、Statementschatbot = ...
2017-11-08 22:21:00
382
转载 ChatterBot - 04 Storage Adapters 存储适配器
机器人通过存储适配器提供的接口链接不同的数据库1. SQL Alchemy 存储适配器class chatterbot.storage.SQLStorageAdapter (***kwargs*)参数:database_rui - 数据配置,sqlite:///db.sqlite3database - 数据库名称,如果配置了database_uri,则此属性可忽略。read...
2017-11-08 22:20:00
473
转载 ChatterBot - 03 Training过程 训练
当机器人训练师加载了一段数据,它会根据加载的数据构建会话机器人的知识图谱,过程如下:1. 训练师类使用列表数据训练chatterbot.trainers.ListTrainer (storage, ***kwargs*)示例1: from chatterbot.trainers import ListTrainer chatterbot = ChatBot("Tr...
2017-11-05 15:31:00
702
转载 ChatterBot - 02 ChatBot类 机器人
1. ChatBot 类class chatterbot.ChatBot (name, ***kwargs*)参数:name ([str]) – 机器人名称,必填-无默认值.preprocessors ([str]) – 前期处理器列表,[chatterbot.preprocessors.clean_whitespace].storage_adapter ([str]) – ...
2017-11-05 15:28:00
240
转载 ChatterBot - 01 简单示例
1. 安装更新$ pip install chatterbot$ pip install chatterbot --upgrade2. 创建机器人from chatterbot import ChatBotchatbot = ChatBot("Ron Obvious")3. 训练机器人from chatterbot.trainers import ListTrainer...
2017-11-05 15:26:00
207
转载 Python Flask-HTTPAuth
Flask-HTTPAuth### 1. Basic authentication example# coding=utf-8from flask import Flaskfrom flask_httpauth import HTTPBasicAuthapp = Flask(__name__)auth = HTTPBasicAuth()users = { "jo...
2017-10-27 09:03:00
649
转载 Scikit-Learn 线性回归
1. 引入包import matplotlib.pyplot as pltimport numpy as npfrom sklearn.linear_model import LinearRegressionfrom sklearn.preprocessing import PolynomialFeaturesimport sysreload(sys)...
2017-08-08 19:13:00
165
转载 Python链接数据库
MYSQL# encoding:utf-8import MySQLdbconn = MySQLdb.connect(host='***.***.***.***', port=3306, user='***', passwd='***', db='****', )cur = conn.cursor()aa = cur.execute('select * from...
2017-08-04 18:26:00
97
转载 Spring Boot Schedule
在启动函数中添加对schedule的支持:@SpringBootApplication@EnableSchedulingpublic class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.c...
2017-08-04 16:23:00
84
转载 结巴分词jieba
常用方式# 全模式text = "我来到北京清华大学"seg_list = jieba.cut(text, cut_all=True)print u"[全模式]: ", "/ ".join(seg_list)# 精确模式seg_list = jieba.cut(text, cut_all=False)print u"[精确模式]: ", "/ "....
2017-08-03 18:41:00
135
转载 删除大日志文件中的某段数据
using System;using System.IO;using System.Linq;using System.Text;namespace TestMultyConsole2{ public class LocalFileHelper { /// <summary> /// 删除大日...
2015-04-29 18:32:00
201
转载 C# 多线程
一、线程之间共享变量:同对象中的变量(线程内部方法)class ThreadTest { bool done; static void Main() { ThreadTest tt = new ThreadTest(); // Create a common instance new Thread(tt.Go)....
2015-03-11 10:21:00
89
转载 10 Tips For C# Programmers
Tip 1: 访问其他项目中的internal方法在项目B中访问项目A的访问修饰符为:internal的方法,示例如下:(MyTestAssembly为写在A项目中Assembly.cs中B项目名称。不支持private/protected)//Make the internals visible to the test assembly[assembly: Int...
2015-02-15 14:14:00
115
转载 关于mybatis中基本类型条件判断问题
一:发现问题sql动态语句中如果 parameterType="int"<select id="sel_campusinfo" parameterType="int" resultType="Campusinfo"> select cmpid,cmpname from campusinfo where state!='d' and cmpid...
2015-01-26 15:38:00
109
转载 C# 多线程访问控件
声明:private delegate void InvokeCallback(Control ctrl, string msg);private void SendMsgToControl(Control ctrl, string msg){ if (ctrl.InvokeRequired) { InvokeCallback m...
2015-01-26 10:58:00
121
转载 GridControl Linq
1. 新增数据GridView的NewItemRowPosition属性设置为Bottom代码: 1 List<ObjectType> DetailCollection { get; set; } 2 private void XXXForm_Load(object sender, EventArgs e) { 3 DetailCollecti...
2013-12-17 10:32:00
112
转载 TreeList Linq
代码:1 private IEnumerable<XXXType> DicCollection { get; set; }2 DicTreeListCtrl.DataSource = DicCollection;转载于:https://www.cnblogs.com/zhuhc/p/3476262.html
2013-12-16 10:34:00
108
转载 MasterDetail Linq
代码: 1 var ds = (from v in XXXCollection 2 where ...... 3 select new { 4 ...... 5 ChildList = (from s in YYYCollection 6 ...
2013-12-16 10:28:00
45
转载 C# 事务处理
代码: 1 using (TransactionScope ts = new TransactionScope()) { 2 try { 3 ...... 4 ts.Complete(); 5 } 6 catch { 7 ...... 8 return; 9 ...
2013-12-10 09:35:00
109
转载 设计模式——代理模式(Proxy Pattern)
1. 作用代理模式支持某些对象控制其他对象的创建和访问。代理一般是由简单对象代替复杂对象,并且这些复杂对象会随着环境的确定而被激活。2. 设计UML图: 说明: 1. Proxy 包含 Subject 对象。 2. Proxy 实现 ISubject 接口。 3. Client 包含 ISubject 接口定义的对象。分类: 1. 虚拟代...
2013-12-05 23:23:00
74
转载 设计模式——装饰模式(Decorator Pattern)
1. 作用装饰模式的作用:提供一种向某个对象动态添加状态和行为的方式。对象不知道它已经“被装饰”了,这使得它成为一种对系统设计非常有用的模式。装饰模式实现的关键点在于:装饰既继承了原始类,也包含装饰的实例。装饰模式的优点: 1.原始类不知道自己被装饰了。 2.不会一个大的,功能丰富的类会包含所有的功能。 3.装饰之间相互独立。 4.装饰可以混合...
2013-12-04 23:56:00
130
转载 C# 调用WCF服务
1 using System; 2 using System.Reflection; 3 using System.ServiceModel; 4 using System.ServiceModel.Channels; 5 6 namespace ManageSystem.Common { 7 public class WCFChannelFact...
2013-12-03 17:50:00
125
转载 加密解密
1 using System; 2 using System.Security.Cryptography; 3 using System.Text; 4 5 namespace ManageSystem.Core { 6 public static class CryptographyHelper { 7 /// <summa...
2013-12-03 17:44:00
184
转载 Effective C#高效编程(02:常量)
前面写过一篇关于常量的文章:const与readonly,C#中的常量有两种定义:const与readonly。const:编译期常量readonly:运行时常量首先分别定义一个常量:1 public const int CurrentYearConst = 2013;2 3 public static readonly int CurrentYearRead...
2013-12-03 15:16:00
90
转载 切换城市功能
与切换城市类似,实例为切换不同的数据库源。主要功能: 1. 记录请求页面 2. 切换数据库源 3. 返回到请求页面 1 public partial class SelectDB : BasePage 2 { 3 ...... 4 public string SrcUrl 5 { 6 get { ...
2013-12-03 09:07:00
204
转载 DataPager控件使用
APSX: 1 <asp:ListView ID="LvResult" runat="server" onpagepropertieschanging="LvResult_PagePropertiesChanging" > 2 ....... 3 </asp:ListView> 4 <asp:DataPager ru...
2013-12-03 08:53:00
648
转载 Effective C#高效编程(01:属性)
在变量的选择上有两种:1.属性;2.数据成员。A.可维护性需要对某一变量的赋值进行验证,属性只需在Setter中做验证,数据成员需查找每一赋值的代码,逐一修改。B.修饰符属性可以为虚的或者抽象的,在接口或者抽象类中定义。C.索引器可使用属性做索引器D.效率属性的效率肯定是没有数据成员效率高,但也不会低多少,JIT内联了一些方法调用,包括属性访问器。所以差别...
2013-12-03 00:05:00
64
转载 微软企业库 Microsoft Enterprise Library 5.0 使用注意事项
原来使用的微软企业库的数据库访问功能,后来根据项目需求,添加缓存功能。使用EntLibConfig.exe配置好缓存之后一直报错,折腾好久,总结分享一下,希望能够帮助到其他人。1.引用DLL文件2.编辑配置文件如果在打开配置文件工具的时候报错,先删除配置文件中相关企业库的配置。3.调用数据库:1 Database db = DatabaseFact...
2013-12-02 16:31:00
192
转载 C# 反射泛型
1 private static string GetValueString(string className, string filedName, int id, Assembly assembly) { 2 Assembly ass = Assembly.GetExecutingAssembly(); 3 Type type = ass.GetType(...
2013-11-30 08:44:00
102
转载 C# 获取属性Attribute
在开发WCF过程中,我们总是会遇到使用[DataContract]、[ServiceContract]、[OperationContract]来描述或者说是规范类,但是一直不知道这些事干啥用的,怎么获取这些我们设定的值,也就是如何验证某一个类的namespace是不是我们规定范围内的。先看一段代码: 1 [DataContract(IsReference=true,Name="M...
2013-11-30 08:34:00
1083
转载 Log4Net使用
1.下载文件下载地址:http://logging.apache.org/log4net/,有源码和dll文件可供下载,有能力的大神可以研究研究源码。解压之后log4net-1.2.13\bin文件夹下面会有四个文件夹,cli,mono,net,net-cp,前连个不知道是在什么情况下用的,后两个主要是针对不同的.net编译程序,每个程序或者是类库都有一个目标框架属性,可右键项目...
2013-11-28 09:19:00
83
转载 C# 获取当前路径
1 System.Environment.CurrentDirectory; 2 "E:\\Svn\\ManageSystem.WinForm\\bin\\Debug" 3 System.Windows.Forms.Application.StartupPath 4 "E:\\Svn\\ManageSystem.WinForm\\bin\\Debug" 5 Syst...
2013-10-24 14:09:00
52
转载 VTL语法
一、引用1.变量格式: $ [ ! ][ { ][ a..z, A..Z ][ a..z, A..Z, 0..9, -, _ ][ } ]举例: Normal 格式: $mud-Slinger_9 Silent 格式: $!mud-Slinger_9 Formal 格式: ${mud-Slinger_9}2.属性格式: $ [ { ...
2013-05-04 16:02:00
413
转载 JQuery Tooltipster
一、简介A powerful, flexible jQuery plugin enabling you to easily create semantic, modern tooltips enhanced with the power of CSS.一款强大的、灵活的JQuery插件,您可以通过使用强大的CSS轻松地创建各种Tooltip。具体地址:http://cal...
2013-03-21 16:50:00
207
转载 控件开发学习笔记(2)
开发服务器控件常用接口: 1.INamingContainer,标识在Page对象的控件层次结构内创建新 ID 命名空间的容器控件。这仅是一个标记接口。 2.IPostBackDataHandler,定义 ASP.NET 服务器控件为自动加载回发数据而必须实现的方法。1 bool LoadPostData(string postDataKey, NameValue...
2013-03-13 10:43:00
89
转载 控件开发学习笔记(1)
1. 选择基类Control类,所有控件都直接或间接继承该类,提供了各类控件通用属性和方法,如唯一标志ID 属性、可见性Visible 等,灵活性最强WebControl类,继承了Control 的所有属性,还增加了布局、可访问性、外观样式等特性;另外,对行为也扩充了好多属性。一般在基于Web 的系统中用得最多,扩展灵活性也很强。CompositeControl类,一般用...
2013-01-24 10:23:00
62
转载 控件属性
1.多行下拉文本属性编辑器1 [Editor("System.ComponentModel.Design.MultilineStringEditor,System.Design", typeof(UITypeEditor))]2 public string TxtEditor3 {4 //... ...5 }2.色值选择属性编辑器1 [E...
2013-01-23 14:50:00
69
转载 [数据库] SQL SERVER CONVERT() 函数日期格式化应用
SELECT CONVERT(varchar(100), GETDATE(), 0)05 16 2006 10:57AMSELECT CONVERT(varchar(100), GETDATE(), 1)05/16/06SELECT CONVERT(varchar(100), GETDATE(), 2)06.05.16SELEC...
2012-03-28 11:33:00
59
转载 const与readonly
const: 编译时常量,在编译成IL时会使用具体数值替换。readonly: 运行时常量,在具体运行时才获取具体值。如:将readonly修饰的赋值Datetime类型,会发现readonly的值是随着运行时间的不同而时间变化的。const是不支持new来赋值的。还有一种情况,switch...casecase可以使用const变量,但不能使用readonly变量...
2012-02-24 11:42:00
66
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人