- 关于提高复杂业务逻辑代码可读性的思考
编程经验分享
开发经验java数据库开发语言
目录前言需求场景常规写法拆分方法领域对象总结前言实际工作中大部分时间都是在写业务逻辑,一般都是三层架构,表示层(Controller)接收客户端请求,并对入参做检验,业务逻辑层(Service)负责处理业务逻辑,一般开发都是在这一层中写具体的业务逻辑。数据访问层(Dao)是直接和数据库交互的,用于查数据给业务逻辑层,或者是将业务逻辑层处理后的数据写入数据库。简单的增删改查接口不用多说,基本上写好一
- 圈层决定未来风景
20d43f9031f0
洋葱打卡145天大家都知道ladyboss是一个教育企业,也知道它正在以光速般飞速前进,从婉琴老师17年独自带着助理媛媛来到深圳落脚,到今天ladyboss实现一场会议千人甚至几千人,我不想说婉琴老师️多厉害,也不想说ladyboss️多牛逼,但是我今天想通过一个简单的圈层分享来告诉大家,ladyboss到底是怎样的一个企业!从进入ladybossdao迄今为止已经8个月,事业合伙人升级到私董走到
- L1 L2 L3 缓存
京天不下雨
windows缓存windows
L1L2L3缓存L1Cache(一级bai缓存)是CPU第一层高速缓存,分为数据缓存和指令缓存。du内置的zhiL1高速缓存的容量和结构对daoCPU的性能影响较大,不过高速缓冲存储器均由静态RAM组成,结构较复杂,在CPU管芯面积不能太大的情况下,L1级高速缓存的容量不可能做得太大。一般服务器CPU的L1缓存的容量通常在32—4096KB。L2由于L1级高速缓存容量的限制,为了再次提高CPU的运
- 莆田鞋多少钱的质量好(盘点莆田鞋零售价格一览表)
美鞋之家
莆田鞋多少钱的质量好(盘点莆田鞋零售价格一览表)莆田鞋,这一词汇在鞋子领域中可谓家喻户晓,以其平易近人的价格和良好的质量赢得了许多消费者的喜爱。那么,莆田鞋的价格到底是多少?它的质量又如何呢?让我们一起来盘点一下。微信:chaodao3(下单赠送精美礼品)莆田鞋零售价格在200元至700元之间,其中主要受鞋子的款式、材质和工艺影响。比如,一双常规的莆田运动鞋大约在250-400元左右,而一双高品质
- java的四个层级结构
活跃家族
JAVA
java的四个层级结构首先,最底层的就是dto层,dto层就是所谓的model,dto中定义的是实体类,也就是.class文件,该文件中包含实体类的属性和对应属性的get、set方法;其次,是dao层(dao层的文件习惯以*Mapper命名),dao层会调用dto层,dao层中会定义实际使用到的方法,比如增删改查。一般在dao层下还会有个叫做sqlmap的包,该包下有xml文件,文件内容正是根据之
- 深入理解AOP(面向切面编程)及其应用
自身就是太阳
java开发语言spring
目录AOP的核心概念AOP的实现方式1.定义DAO接口和实现类2.定义通知类3.开启AOP注解驱动切入点表达式通配符的使用:AOP通知类型案例分析:测量业务层接口的执行效率结论概述:AOP(Aspect-OrientedProgramming,面向切面编程)是一种编程范式,主要用于将共性功能从具体的业务逻辑中分离出来,实现松耦合的代码设计。其作用是在不修改原始代码的情况下,对现有方法进行增强,广泛
- SpringBoot项目
俺叫啥好嘞
spring系列springspringboot
SpringBoot项目大概分为四层:(1)DAO层:包括XxxMapper.java(数据库访问接口类),XxxMapper.xml(数据库链接实现);(这个命名,有人喜欢用Dao命名,有人喜欢用Mapper,看个人习惯了吧)(2)Bean层:也叫model层,模型层,entity层,实体层,就是数据库表的映射实体类,存放POJO对象;(3)Service层:也叫服务层,业务层,包括XxxSer
- 【Java】已解决:org.springframework.dao.DataAccessException
屿小夏
javaoracle数据库
文章目录一、分析问题背景二、可能出错的原因三、错误代码示例四、正确代码示例五、注意事项已解决:org.springframework.dao.DataAccessException一、分析问题背景在Spring框架中,org.springframework.dao.DataAccessException是一个常见的异常类型,通常出现在与数据库交互的过程中。当应用程序尝试执行数据库操作(例如查询、插
- 详解Spring中的单例模式
dawn191228
JavaWebspring单例模式java后端servlet
目录什么是单例模式?单例模式的优缺点优点缺点如何设置单例模式?单例模式的实现方式饿汉式单例懒汉式单例总结单例模式的实际应用UserDao类UserService类(成员变量包含一个UserDao)什么是单例模式?单例模式是设计模式中最简单也是最常用的设计模式之一,单例顾名思义就是系统中只有唯一实例,这个唯一实例的获取方式就是通过一个方法的调用获得,而不是通过正常流程中的new实例化。在Spring
- springboot工作流程
月阴荒
springbootspringjava
springboot的工作流程:1.手动运行启动类BootApplication.java,同时启动内置tomcat2.注解@MapperScan(“com.xly.dao”)读取到dao层3.加载配置文件,读取端口号,建立JDBC连接,读取到dao层的Mapper配置文件等其他配置4.dao层之后的Service,Controller正常走Spring加载流程5.Service自动装配记录dao
- mybatis批量插入、mybatis-plus批量插入、mybatis实现insertList、mybatis自定义实现批量插入
五月天的尾巴
springbootmybatismybatis批量插入
文章目录一、mybatis新增批量插入1.1、引入依赖1.2、自定义通用批量插入Mapper1.3、把通用方法注册到mybatisplus注入器中1.4、实现InsertList类1.5、需要批量插入的dao层继承批量插入Mapper二、可能遇到的问题2.1、Invalidboundstatement众所周知,mybatisplus提供的BaseMapper里只有单条插入的方法,没有批量插入的方法
- spring boot 之自动装配
luckyHarry4
前言在最初接触spring的时候,还是使用xml进行装配,我记得很清楚,当时分别配置了spring-dao.xml,spring-service.xml,spring-controller.xml。然后把所有需要用到的扫包,注入bean,以及配置,全都一股脑的塞进xml中,虽然出发点很好,不用在java代码中硬编码了,但是xml的可读性并不是很好,那阵子,真是痛苦的要命。正文后来逐渐的接触到了sp
- SprinBoot+Vue远程教育网站的设计与实现
赵广陆
projectvue.js前端javascript
目录1项目介绍2项目截图3核心代码3.1Controller3.2Service3.3Dao3.4application.yml3.5SpringbootApplication3.5Vue4数据库表设计5文档参考6计算机毕设选题推荐7源码获取1项目介绍博主个人介绍:CSDN认证博客专家,CSDN平台Java领域优质创作者,全网30w+粉丝,超300w访问量,专注于大学生项目实战开发、讲解和答疑辅导
- MVC和三层架构和Dao,service,controller的区别
xwh-
mvc架构
一。MVCMVC(Model-View-Controller)是一种常见的软件架构模式,用于组织和管理应用程序的代码。它将应用程序分为三个主要的组成部分:模型(Model)、视图(View)和控制器(Controller)。模型(Model):模型代表应用程序的数据和业务逻辑。它负责处理数据的读取、存储、验证和计算等操作,以及定义业务规则。模型是应用程序的核心,通常包含与数据库交互的代码。视图(V
- JavaBean、MVC设计模式与Java中Dao、Service、Controll三层体系
Java糖糖
mavenspringboot后端javaspring
文章目录一、JavaBeanJavaBean实际就是一个普通的Java类,为了规范开发,要求JavaBean具有如下规范:①具有一个公共的、无参的构造方法;②类的属性私有,且必须提供公共的setter和getter方法用于外部对属性赋值和获取属性值;简而言之:JavaBean=属性私有+公共的setter/getter方法+空参构造器ORM编程思想(objectrelationalmapping,
- 开源软件新峰商城之DAO接口
ch_s_t
Javajava数据库前端
一、数据表设计管理员用户表tb_newbee_mall_admin_useradmin_user_id:管理员id,自增主键,用于唯一标识每个管理员用户。login_user_name:管理员登陆名称,用于管理员登录系统。login_password:管理员登陆密码,与登录用户名配合进行登录验证。nick_name:管理员显示昵称,用于在系统中显示管理员的称呼。locked:是否锁定0未锁定1已锁
- 设计之道:ORM、DAO、Service与三层架构的规范探索
VaporGas
Java后端重构java设计规范ORMDAOService三层架构
引言:实际开发中,遵守一定的开发规范,不仅可以提高开发效率,还可以提高项目的后续维护性以及项目的扩展性;了解一下本博客的项目设计规范,对项目开发很有意义一、ORM思想ORM(Object-Relational-Mapping)在对象模型和关系型模型之间做一个映射(转换)。目的是为了解决面向对象编程语言的发展和关系型数据库的发展不匹配的问题可以理解为:将Java中的数据结构与MySQL数据库中的数据
- 如何使用JPA自定义更新的sql语句实现对数据表的修改?——SpringDataJpa实现自定义(更新)update语句
海海不掉头发
笔记allsqlitesqlintellijideajapjpa
文章目录前言一、DAO层/Mapper层二、Service业务处理层三、Controller控制层总结前言有的时候我们在后台管理系统中只需要修改一列的数据时,JPA的操作死对所有字段进行修改,这样就不太方便,而且SpringDataJpa的框架没有线程的更新方法,只能调用save()方法实行保存修改的数据。如果不想把其中一列的数据修改的话,那么JPA就会自动把这一列不想修改的数据默认null,并且
- EOFParserException: EOF
妙明元心
mybatissql
在使用mybatis接受list等集合遍历时,没有对list等进行size>0判断,会产生如下异常:Causedby:com.alibaba.druid.sql.parser.EOFParserException:EOF需要修改进行如下判断:0">andidin#{id}或者:在调用dao方法前进行判断,list!=null&&list.size>0
- SprinBoot+Vue动漫交流与推荐平台的设计与实现
赵广陆
projectvue.js前端javascript
目录1项目介绍2项目截图3核心代码3.1Controller3.2Service3.3Dao3.4application.yml3.5SpringbootApplication3.5Vue4数据库表设计5文档参考6计算机毕设选题推荐7源码获取1项目介绍博主个人介绍:CSDN认证博客专家,CSDN平台Java领域优质创作者,全网30w+粉丝,超300w访问量,专注于大学生项目实战开发、讲解和答疑辅导
- 第九届中国大学生程序设计竞赛(秦皇岛)-(CCPC2023-Qinhuangdao F - 质数之谜(DP)
szy10010
算法c++动态规划
题意给定一个序列,修改最少数量的元素使得任意i属于[1,n-1],q[i]+q[i+1]都为质数,输出最小修改次数思路首先手玩的过程中可以发现,如果因为前面一个数字和自己相加不是质数然后我把自己变成了奇数,那么如果我后面一个数字是偶数可以发现自己肯定能找到另一个奇数使得和前面相加互质并且和后面相加也互质举个例子:假设为2810,我此时是8,我发现2+8不是质数把自己改为5,但是5+10不是质数,但
- JavaWeb后端分层
灵佑666
Java
1.Dao层:全称DataAccessObject。Dao层比较底层,负责与数据库打交道具体到对某个表、某个实体的增删改查2.Service层:又叫服务层或业务层,封装Dao层的操作,使一个方法对外表现为实现一种功能,例如:网购生成订单时,不仅要插入订单信息记录,还要查询商品库存是否充足,购买是否超过限制等等。3.Controller层:业务控制层,负责接收数据和请求,并且调用Service层实现
- JDBC
yulijun6943
javajdbcjavamysql数据库大数据
JDBC一概念二JDBC开发步骤【`重点`】三ResultSet(结果集)3.1接收结果集3.2遍历ResultSet中的数据3.3常见错误四PreparedStatement【`重点`】4.1PreparedStatement的应用4.1.1动态参数绑定五封装工具类5.1重用性方案5.2跨平台方案5.2.1六ORM6.1实体类(entity):零散数据的载体七DAO数据访问对象(DataAcce
- Spring Boot动态数据源切换
tuacy
在实际开发过程中,可能有这样的情况,一个项目涉及到多个数据库.有的数据需要插入这个数据库,而有的数据需要插入到另一个数据库里面.所以接下来,就来教大家怎么用最简单的方式来实现这一需求.我们将会用Spring里面的AOP设计来实现这一逻辑.通过把注解添加在方法上(DAO方法上)来实现数据源的动态切换.简单来说就是当前方法操作的是哪个数据源,我们就需要在方法上添加注解标识使用哪个数据源.我们注意到在S
- Spring IOC
LongProgrammer
spring数据库java
什么是Spring概念:是一款开源轻量级应用程序框架主要用企业级的构建程序,解决复杂性的业务问题,使用Spring开发可以将Bean对象,Dao组件对象,Service组件对象等交给Spring容器来管理。作用:提高开发效率,降低代码的耦合度,提高代码的复用性,提高代码的键状性谈谈Spring的两个核心模块ioc的概念:控制反转是一种设计思想将你设计好的对象交给容器控制ioc控制反转:将创建好的对
- 装win10,点快速设置之后就无限重启
叶迎宪
https://zhidao.baidu.com/question/1112150598310860339.htmlhttps://www.zhihu.com/question/34366044电脑是通过老毛桃U盘装的win10镜像,结果装完就遇到无限重启的问题。百度知道上面有人提到,快速设置的时候要插网线。可是试了,还是无限重启。更多人提倡的办法是在快速设置界面,按下ctrl+shift+F3,
- docker网站
水彩橘子
docker运维linux
1、安装docker环境curl-sSLhttps://get.daocloud.io/docker|shvi/etc/docker/daemon.json添加如下{"insecure-registries":["harbor.wtown.com"],"registry-mirrors":["http://hub-mirror.c.163.com"]}启动systemctldaemon-reloa
- Spring实现纯注解项目开发
dawn191228
JavaWebspringjava后端servlet
目录为什么使用注解开发?Spring开发中的常用注解Bean管理类常用的四个注解(作用相同,名称不同)依赖注入相关的注解(加在成员变量上)对象生命周期注解初始化方法和销毁方法其他注解代码示例1.导入Maven依赖2.创建实体类(用于接收从数据库中查询到的信息)3.编写Service层和Dao层查询3.1Service层3.2Dao层4.创建配置类(代替xml配置文件)5.在配置文件中开启注解扫描6
- SprinBoot+Vue宠物领养救助微信小程序的设计与实现
赵广陆
projectvue.js宠物微信小程序
目录1项目介绍2项目截图3核心代码3.1Controller3.2Service3.3Dao3.4application.yml3.5SpringbootApplication3.5Vue3.6uniapp代码4数据库表设计5文档参考6计算机毕设选题推荐7源码获取1项目介绍博主个人介绍:CSDN认证博客专家,CSDN平台Java领域优质创作者,全网30w+粉丝,超300w访问量,专注于大学生项目实
- SprinBoot+Vue阅读交流微信小程序的设计与实现
赵广陆
projectvue.js微信小程序springboot
目录1项目介绍2项目截图3核心代码3.1Controller3.2Service3.3Dao3.4application.yml3.5SpringbootApplication3.5Vue3.6uniapp代码4数据库表设计5文档参考6计算机毕设选题推荐7源码获取1项目介绍博主个人介绍:CSDN认证博客专家,CSDN平台Java领域优质创作者,全网30w+粉丝,超300w访问量,专注于大学生项目实
- 深入浅出Java Annotation(元注解和自定义注解)
Josh_Persistence
Java Annotation元注解自定义注解
一、基本概述
Annontation是Java5开始引入的新特征。中文名称一般叫注解。它提供了一种安全的类似注释的机制,用来将任何的信息或元数据(metadata)与程序元素(类、方法、成员变量等)进行关联。
更通俗的意思是为程序的元素(类、方法、成员变量)加上更直观更明了的说明,这些说明信息是与程序的业务逻辑无关,并且是供指定的工具或
- mysql优化特定类型的查询
annan211
java工作mysql
本节所介绍的查询优化的技巧都是和特定版本相关的,所以对于未来mysql的版本未必适用。
1 优化count查询
对于count这个函数的网上的大部分资料都是错误的或者是理解的都是一知半解的。在做优化之前我们先来看看
真正的count()函数的作用到底是什么。
count()是一个特殊的函数,有两种非常不同的作用,他可以统计某个列值的数量,也可以统计行数。
在统
- MAC下安装多版本JDK和切换几种方式
棋子chessman
jdk
环境:
MAC AIR,OS X 10.10,64位
历史:
过去 Mac 上的 Java 都是由 Apple 自己提供,只支持到 Java 6,并且OS X 10.7 开始系统并不自带(而是可选安装)(原自带的是1.6)。
后来 Apple 加入 OpenJDK 继续支持 Java 6,而 Java 7 将由 Oracle 负责提供。
在终端中输入jav
- javaScript (1)
Array_06
JavaScriptjava浏览器
JavaScript
1、运算符
运算符就是完成操作的一系列符号,它有七类: 赋值运算符(=,+=,-=,*=,/=,%=,<<=,>>=,|=,&=)、算术运算符(+,-,*,/,++,--,%)、比较运算符(>,<,<=,>=,==,===,!=,!==)、逻辑运算符(||,&&,!)、条件运算(?:)、位
- 国内顶级代码分享网站
袁潇含
javajdkoracle.netPHP
现在国内很多开源网站感觉都是为了利益而做的
当然利益是肯定的,否则谁也不会免费的去做网站
&
- Elasticsearch、MongoDB和Hadoop比较
随意而生
mongodbhadoop搜索引擎
IT界在过去几年中出现了一个有趣的现象。很多新的技术出现并立即拥抱了“大数据”。稍微老一点的技术也会将大数据添进自己的特性,避免落大部队太远,我们看到了不同技术之间的边际的模糊化。假如你有诸如Elasticsearch或者Solr这样的搜索引擎,它们存储着JSON文档,MongoDB存着JSON文档,或者一堆JSON文档存放在一个Hadoop集群的HDFS中。你可以使用这三种配
- mac os 系统科研软件总结
张亚雄
mac os
1.1 Microsoft Office for Mac 2011
大客户版,自行搜索。
1.2 Latex (MacTex):
系统环境:https://tug.org/mactex/
&nb
- Maven实战(四)生命周期
AdyZhang
maven
1. 三套生命周期 Maven拥有三套相互独立的生命周期,它们分别为clean,default和site。 每个生命周期包含一些阶段,这些阶段是有顺序的,并且后面的阶段依赖于前面的阶段,用户和Maven最直接的交互方式就是调用这些生命周期阶段。 以clean生命周期为例,它包含的阶段有pre-clean, clean 和 post
- Linux下Jenkins迁移
aijuans
Jenkins
1. 将Jenkins程序目录copy过去 源程序在/export/data/tomcatRoot/ofctest-jenkins.jd.com下面 tar -cvzf jenkins.tar.gz ofctest-jenkins.jd.com &
- request.getInputStream()只能获取一次的问题
ayaoxinchao
requestInputstream
问题:在使用HTTP协议实现应用间接口通信时,服务端读取客户端请求过来的数据,会用到request.getInputStream(),第一次读取的时候可以读取到数据,但是接下来的读取操作都读取不到数据
原因: 1. 一个InputStream对象在被读取完成后,将无法被再次读取,始终返回-1; 2. InputStream并没有实现reset方法(可以重
- 数据库SQL优化大总结之 百万级数据库优化方案
BigBird2012
SQL优化
网上关于SQL优化的教程很多,但是比较杂乱。近日有空整理了一下,写出来跟大家分享一下,其中有错误和不足的地方,还请大家纠正补充。
这篇文章我花费了大量的时间查找资料、修改、排版,希望大家阅读之后,感觉好的话推荐给更多的人,让更多的人看到、纠正以及补充。
1.对查询进行优化,要尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引。
2.应尽量避免在 where
- jsonObject的使用
bijian1013
javajson
在项目中难免会用java处理json格式的数据,因此封装了一个JSONUtil工具类。
JSONUtil.java
package com.bijian.json.study;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
- [Zookeeper学习笔记之六]Zookeeper源代码分析之Zookeeper.WatchRegistration
bit1129
zookeeper
Zookeeper类是Zookeeper提供给用户访问Zookeeper service的主要API,它包含了如下几个内部类
首先分析它的内部类,从WatchRegistration开始,为指定的znode path注册一个Watcher,
/**
* Register a watcher for a particular p
- 【Scala十三】Scala核心七:部分应用函数
bit1129
scala
何为部分应用函数?
Partially applied function: A function that’s used in an expression and that misses some of its arguments.For instance, if function f has type Int => Int => Int, then f and f(1) are p
- Tomcat Error listenerStart 终极大法
ronin47
tomcat
Tomcat报的错太含糊了,什么错都没报出来,只提示了Error listenerStart。为了调试,我们要获得更详细的日志。可以在WEB-INF/classes目录下新建一个文件叫logging.properties,内容如下
Java代码
handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHa
- 不用加减符号实现加减法
BrokenDreams
实现
今天有群友发了一个问题,要求不用加减符号(包括负号)来实现加减法。
分析一下,先看最简单的情况,假设1+1,按二进制算的话结果是10,可以看到从右往左的第一位变为0,第二位由于进位变为1。
 
- 读《研磨设计模式》-代码笔记-状态模式-State
bylijinnan
java设计模式
声明: 本文只为方便我个人查阅和理解,详细的分析以及源代码请移步 原作者的博客http://chjavach.iteye.com/
/*
当一个对象的内在状态改变时允许改变其行为,这个对象看起来像是改变了其类
状态模式主要解决的是当控制一个对象状态的条件表达式过于复杂时的情况
把状态的判断逻辑转移到表示不同状态的一系列类中,可以把复杂的判断逻辑简化
如果在
- CUDA程序block和thread超出硬件允许值时的异常
cherishLC
CUDA
调用CUDA的核函数时指定block 和 thread大小,该大小可以是dim3类型的(三维数组),只用一维时可以是usigned int型的。
以下程序验证了当block或thread大小超出硬件允许值时会产生异常!!!GPU根本不会执行运算!!!
所以验证结果的正确性很重要!!!
在VS中创建CUDA项目会有一个模板,里面有更详细的状态验证。
以下程序在K5000GPU上跑的。
- 诡异的超长时间GC问题定位
chenchao051
jvmcmsGChbaseswap
HBase的GC策略采用PawNew+CMS, 这是大众化的配置,ParNew经常会出现停顿时间特别长的情况,有时候甚至长到令人发指的地步,例如请看如下日志:
2012-10-17T05:54:54.293+0800: 739594.224: [GC 739606.508: [ParNew: 996800K->110720K(996800K), 178.8826900 secs] 3700
- maven环境快速搭建
daizj
安装mavne环境配置
一 下载maven
安装maven之前,要先安装jdk及配置JAVA_HOME环境变量。这个安装和配置java环境不用多说。
maven下载地址:http://maven.apache.org/download.html,目前最新的是这个apache-maven-3.2.5-bin.zip,然后解压在任意位置,最好地址中不要带中文字符,这个做java 的都知道,地址中出现中文会出现很多
- PHP网站安全,避免PHP网站受到攻击的方法
dcj3sjt126com
PHP
对于PHP网站安全主要存在这样几种攻击方式:1、命令注入(Command Injection)2、eval注入(Eval Injection)3、客户端脚本攻击(Script Insertion)4、跨网站脚本攻击(Cross Site Scripting, XSS)5、SQL注入攻击(SQL injection)6、跨网站请求伪造攻击(Cross Site Request Forgerie
- yii中给CGridView设置默认的排序根据时间倒序的方法
dcj3sjt126com
GridView
public function searchWithRelated() {
$criteria = new CDbCriteria;
$criteria->together = true; //without th
- Java集合对象和数组对象的转换
dyy_gusi
java集合
在开发中,我们经常需要将集合对象(List,Set)转换为数组对象,或者将数组对象转换为集合对象。Java提供了相互转换的工具,但是我们使用的时候需要注意,不能乱用滥用。
1、数组对象转换为集合对象
最暴力的方式是new一个集合对象,然后遍历数组,依次将数组中的元素放入到新的集合中,但是这样做显然过
- nginx同一主机部署多个应用
geeksun
nginx
近日有一需求,需要在一台主机上用nginx部署2个php应用,分别是wordpress和wiki,探索了半天,终于部署好了,下面把过程记录下来。
1. 在nginx下创建vhosts目录,用以放置vhost文件。
mkdir vhosts
2. 修改nginx.conf的配置, 在http节点增加下面内容设置,用来包含vhosts里的配置文件
#
- ubuntu添加admin权限的用户账号
hongtoushizi
ubuntuuseradd
ubuntu创建账号的方式通常用到两种:useradd 和adduser . 本人尝试了useradd方法,步骤如下:
1:useradd
使用useradd时,如果后面不加任何参数的话,如:sudo useradd sysadm 创建出来的用户将是默认的三无用户:无home directory ,无密码,无系统shell。
顾应该如下操作:
- 第五章 常用Lua开发库2-JSON库、编码转换、字符串处理
jinnianshilongnian
nginxlua
JSON库
在进行数据传输时JSON格式目前应用广泛,因此从Lua对象与JSON字符串之间相互转换是一个非常常见的功能;目前Lua也有几个JSON库,本人用过cjson、dkjson。其中cjson的语法严格(比如unicode \u0020\u7eaf),要求符合规范否则会解析失败(如\u002),而dkjson相对宽松,当然也可以通过修改cjson的源码来完成
- Spring定时器配置的两种实现方式OpenSymphony Quartz和java Timer详解
yaerfeng1989
timerquartz定时器
原创整理不易,转载请注明出处:Spring定时器配置的两种实现方式OpenSymphony Quartz和java Timer详解
代码下载地址:http://www.zuidaima.com/share/1772648445103104.htm
有两种流行Spring定时器配置:Java的Timer类和OpenSymphony的Quartz。
1.Java Timer定时
首先继承jav
- Linux下df与du两个命令的差别?
pda158
linux
一、df显示文件系统的使用情况,与du比較,就是更全盘化。 最经常使用的就是 df -T,显示文件系统的使用情况并显示文件系统的类型。 举比例如以下: [root@localhost ~]# df -T Filesystem Type &n
- [转]SQLite的工具类 ---- 通过反射把Cursor封装到VO对象
ctfzh
VOandroidsqlite反射Cursor
在写DAO层时,觉得从Cursor里一个一个的取出字段值再装到VO(值对象)里太麻烦了,就写了一个工具类,用到了反射,可以把查询记录的值装到对应的VO里,也可以生成该VO的List。
使用时需要注意:
考虑到Android的性能问题,VO没有使用Setter和Getter,而是直接用public的属性。
表中的字段名需要和VO的属性名一样,要是不一样就得在查询的SQL中
- 该学习笔记用到的Employee表
vipbooks
oraclesql工作
这是我在学习Oracle是用到的Employee表,在该笔记中用到的就是这张表,大家可以用它来学习和练习。
drop table Employee;
-- 员工信息表
create table Employee(
-- 员工编号
EmpNo number(3) primary key,
-- 姓