- python下报错AttributeError: 'NoneType' object has no attribute 'shape'
无止境x
路径问题:config.TRAIN.hr_img_path=r'D:\SR_datasets\DIV2K\DIV2K_train_HR/'#最后还要加一个/斜杠
- 【第一章概述—计算机中的数制】十进制数制转换为二进制数制,整数和小数如何计算
命运之光
#微机原理与接口技术学习
将十进制数转换为二进制数,涉及到整数部分和小数部分的分别处理。下面是详细的步骤:1.整数部分转换为二进制步骤:不断将整数部分除以2:记录每次除法得到的余数,直到商为0为止。将余数逆序排列:最后得到的数字就是整数部分的二进制表示。例子:将十进制整数45转换为二进制。45÷2=22余122÷2=11余011÷2=5余15÷2=2余12÷2=1余01÷2=0余145\div2=22\text{余}1\\
- Servlet学习(一):jquary和json
青城小虫
servlet学习json
一、jquary的学习和使用1.什么是jquaryjQuery是一个JavaScript库。jQuery极大地简化了JavaScript编程。jQuery很容易学习。2.jquary和原生js对比获取input框中的数据和div框中的数据Inserttitlehere用户名:密码:div1div2functiongetInput(){varusername=$("#userName").val()
- 九齐NY8BE62D软件开发
wiyoo0
单片机嵌入式硬件
开启100us中断voidTime_Init(void){DISI();//;InitialTimer0PCON1=C_TMR0_Dis;//DisableTimer0TMR0=100;//Load0x00toTMR0(InitialTimer0register)T0MD=C_PS0_TMR0|C_PS0_Div2;INTE=C_INT_TMR0;PCON1=C_TMR0_En;//EnableT
- JS实现div块的拖放,调换位置
端木安玉
主要是HTML5的拖放(Drag和Drop)例子(不需要对div设置ID):废话不多说,直接上代码div1!div2!div3functionallowDrop(ev){ev.preventDefault();}varsrcdiv=null;functiondrag(ev,divdom){srcdiv=divdom;ev.dataTransfer.setData("text/html",divdo
- javaEE 初阶 — CSS 选择器
与大师约会
javaEE从入门到进阶css前端java-eehtml
文章目录CSS选择器1.标签选择器2.类选择器3.ID选择器4.后代选择器5.子选择器6.并集选择器7.伪类选择器(复合选择器的特殊用法)CSS选择器1.标签选择器标签选择器是在大括号的前面写上标签的名字,此时意味着会选中当前页面中的所有指定标签。我真帅div{font-size:30px;color:green;}这是一个div这是一个div这是一个div2.类选择器标签选择器只能针对所有的指定
- 第十二周学习报告
三冬四夏会不会有点漫长
#算法训练周报学习算法
比赛参加了一场div2,B题,C题没写出来,B是一个排序去重+双指针,C题是要观察出一个数学结论(因为数据范围太大,我暴力做直接超时了)排6253,表现分是998,938->996自己之后训练的重点就是前面div2前面三个题做题情况cf:1881B(模拟)1921C(贪心)1916B(最大公约数)1915D(字符串)1907B(字符串)1896B(猜结论)1883C(贪心)1883B(回文串)18
- 谁是组长
qq_45719856
c++c语言
八中信息组需要选一个组长。信息组一共有n个人,分别用1到n编号,其中m个人参与了投票。得票数过半(票数大于mdiv2)的人将被选为组长。输入数据将告知这m个人分别将票投给了谁,请统计出谁将担任八中信息组的组长。输入格式第一行两个数n和m。第二行有m个数,这些数都是不超过n的正整数,表明这m个人的选择。输出格式输出将被选为组长的人。如果没有人的票数过半,请输出-1。输入样例747727输出样例7方法
- CF 380 Div2 F题
ahdvy48402
两个人轮流操作,一个人想要差最大,另外一个想最小,然后最简单的方法是f[l][r][k][flag]表示还剩[l,r]这个区间还没有选,只能选k和k+1,flag为0或1,时的最优值。传统的这种表示方法状态量非常大,其他思路又感觉不明显,我该怎么办?仔细观察,好像这样表示会很浪费空间,因为当flag为1时l+r-1>=n,当flag为0时l+r-1<=n,并且abs(l+r-1-n)的值很小,设为
- cf921(Div2)C题
Colinnian
c++算法开发语言题目总结
寻找一段长为m的序列当中不存在的子序列Problem-C-Codeforcesvoidsolve(){intn,k,m;std::cin>>n>>k>>m; std::strings;std::cin>>s; std::stringt;intj=0;boolok=true;//长为nfor(inti=0;iocc(k);//计k个,在m个字符中找while(cnt>n>>k>>m;std::str
- div 2_div 3_ div 4_刷题刷题刷题
三冬四夏会不会有点漫长
#算法训练周报算法
关于div4的思考感觉好像可以写到F都不需要什么算法知识关于div3的思考感觉可以做到E好像都不需要什么算法知识关于div2的思考好像做到C都不需要什么算法知识赶紧刷题就行,加油加油
- 事件高级1
特立独行的兔子_web
1事件冒泡当一个元素接收到事件的时候会把他接收到的事件传给自己的父级,一直到window。当某个dom上的事件被触发,那么其父级元素的该事件也会被逐级触发。例子1:vardiv1=document.getElementById("div1");vardiv2=document.getElementById("div2");div2.onclick=function(){console.log(‘我
- codeforces round 922 div2 (C题 xor-distance)
像风一样_
算法c++
xor-distance这个题考察了异或运算和贪心策略,对位运算不熟悉的人可能会有些懵逼,比如我.1,首先要想明白的一件事是,如果a,b某二进制位相同,那不管x这一位是0,还是1,最后这一位相减的结果都为0,无影响,所以从两个数第一个不同的位开始考虑即可,以此为最高位2,第二,而如果a,b这一位不同,那么x为1的话会反转这一位相减的结果(即变成相反数).所以如果最高位为正,则后面的结果尽可能为负即
- 第十一周学习报告
三冬四夏会不会有点漫长
算法竞赛#算法训练周报学习
知识点复习了一些基本算法,二分,前缀和,差分,双指针,离散化,位运算,归并排序,高精度等比赛情况无做题情况1.CFdiv2A(10题):A.WeGotEverythingCovered!,A.SatisfyingConstraints,A.LeastProduct,A.RatingIncrease,A.ConstructiveProblems,A.BinaryImbalance,A.Halloum
- CF补题[长期更新]
zhonglong_lin
CF
现在主要写div2的题,从前往后写到实在不会写,思路很简单的就不记录了-E.GamewithString题意:两个人玩游戏,AB都知道原字符串s,A将s从下表为k的位置断开,左右交换组成新的字符穿tB猜k,求b的赢得几率B有两个手段1.先看新字符串t的首字母也就是s[k+1]2.看完首字母后决定看t的任意一个字符最后求B能百分百猜对t的概率简单的博弈概率题目图书馆要关了,先存档一下,明天再写#in
- CF 775 Div2 补题
lqrs
codefoecesc++
个人记录,如题D:一个数组a,若ai≤aja_i\leqa_jai≤aj,则一定存在⌊aj/ai⌋⌊a_j/a_i⌋⌊aj/ai⌋,则输出Yes,反之输出No枚举aia_iai,查询数列a中是否存在(ai∗k,ai∗k−1)(a_i*k,a_i*k-1)(ai∗k,ai∗k−1)中的数,再判断k是否再数组中,时间复杂度是调和级数。#include#includeusingnamespacestd;
- Codeforces1300(618Round Div2)
Young_Zn_Cu
Codeforces
题目题解写在前面(牢骚&废话&一丢丢总结):不好好打场比赛都不知道自己到底有多菜.jpg.jpg.jpg第一次打CodeforcesCodeforcesCodeforces就掉RatingRatingRating祭一开始因为操作不熟和网站太慢,别人都快做完前两道题了才开始做,第一次提交的时候语言没调对还没反应过来愣是CECECE了三次估计刷新了OIOIOI界低级错误的sb程度AAA题这种难度的题都
- 【前端学习】CSS入门
woodwhale
与君共勉css前端css3html
前端学习:CSS入门文章目录前端学习:CSS入门前言1、class011.我的第一个CSS2.导入方式3.基本选择器(1)ID选择器(2)标签选择器(3)类选择器4.层次选择器5.结构伪类选择器6.属性选择器2、class021.span/div2.字体样式3.文本样式4.超链接伪类5.列表3、class031.盒子模型2.内外边距3.圆角边框4.盒子阴影5.浮动6.定位7.z-index后话前言
- z-index的用法及失效
云烟成雨点
z-index:用于提升元素层级默认值为0这就像是栋房子,2楼的小矮子会位于1楼的大高个上面。图中DIV1有1和2两个子元素,DIV2有3和4两个子元素。最终呈现在页面上的效果如图,堆叠顺序从上到下依次是A,B,C,D。A会显示在最上面。对于浮动的元素:浮动的元素脱离文档流,就好比去了二楼为浮动的元素仍然停留在一楼,所以给一楼的元素添加z-index值并不能盖过二楼的元素
- 寒假思维训练计划day16 A. Did We Get Everything Covered?
嘗_
算法c++
今天更新一道1月27号晚上div2的C题作为素材,感觉用到了我的构造题总结模型,我总结了一系列的模型和例题。摘要:Part1定义"边界贪心法"Part2题意Part3题解Part4代码Part5思维构造题模型和例题Part1边界贪心法(该题所用到的模型):边界贪心法:对于整体而言,我们去除已经定好的情况,剩下难以确定的情况,我们从其最边缘的位置去考虑、去假设;一般要在问题的最边界处考虑,一般最边界
- rem布局
Gao_xu_sheng
csshtmljavascript
1.0rem基础1.1em单位(了解)结论1:1em默认字体大小是16像素结论2:em这个单位会默认参考父元素字体大小为基准/*结论1:1em默认字体大小是16像素结论2:em这个单位会默认参考父元素字体大小为基准*//*html{如果根元素默认字体大小设置为20px,那么所有子元素默认字体大小为20pxfont-size:20px;}*/我是div1我是div2我是div3我是div4我是父亲d
- 2024.1.24 寒假训练记录(7)
Texcavator
2024寒假训练记录算法c++
白天写了会儿洛谷的数据结构题单,按顺序写的没写到什么难题就不写在这了,然后就是准备明天的讲课加一场div2,但div2还没补d,d等过几天再写^o^文章目录CF1778AFlipFlopSumCF1778BTheForbiddenPermutationCF1778CFlexibleStringCF1778AFlipFlopSum题目链接大水题#includeusingnamespacestd;ty
- vivado时序约束
拉钩上吊一百年
fpgafpga开发
1.时钟周期约束基础时钟周期为10ns的基础时钟create_clock-period10[get_portssys_clk]生成时钟生成时钟为通过组合逻辑自己生成的时钟驱动。(MMCM、PLL、BUFR输出的时钟不是生成时钟,vivado会自动识别,不需要额外约束)。如图是经典二分频生成时钟,其输出的时钟约束应当为:create_generated_clock-nameclkdiv2-sourc
- Codeforces Round 907 div2 F. A Growing Tree
吵闹的人群保持笑容多冷静
codeforces练习深度优先算法c++
F.AGrowingTree题意给定一个有根树,初始只有根节点111。每个节点都有一个点权,初始皆为000。现有两种操作:1vi1\hspace{3pt}v_i1vi,给viv_ivi添加一个新的儿子,新加儿子的编号是连续累加的。2vixi2\hspace{3pt}v_i\hspace{3pt}x_i2vixi,将现在viv_ivi的子树中所有点的点权+xi+x_i+xiqqq次操作后输出所有点的
- Echars自定义地图---热力图demo
别把我的桃子拿走了
热力图EcharsEchars自定义地图
Echars自定义地图—热力图demo1.创建自定义地图使用http://geojson.io画出地图,获得地图json数据。适用于画简单的线条,如果是复杂的可能就不是那么实用了。2.导包官网下载Echars.js3.echarts配置1.初始化一个布局容器,一般是div2.配置optionfunctiongetQueryVariable(variable){varquery=window.loc
- jQuery样式操作&click事件
吕若凡
jQuery样式操作.div2{color:red;}.big{font-size:30px;}$(function(){/*jQuery用同一个函数即可以取值、也可以赋值*///读取样式alert($('#div1').css('fontSize'));//16px//设置(写入)样式$('#div1').css({background:'gold'});//增加行间样式$('#div1').a
- cf919Div2C题题目总结
Colinnian
算法题目讲解
Problem-C-Codeforces这道题其实是一道数学题。先看第一个变量,也就是我们要求的答案k的数量,但看k是很好确定它的限制条件的,要想均匀分成k份,n%k必须为0,有了k,我们再来看m,对于a(1)和a(k+1),要使它们除以m后相同,肯定满足一下式子a(1)=x1*m1+n1,a(k+1)=y1*m1+n1对于其它的对应的a也是一样的,a(2)=x2*m2+n2,a(k+2)=y2*
- WEB前端人机交互导论实验-实训6 表格与表格页面布局
起床悠悠
前端htmlcss前端html5css
1.项目1设计《网络主题研讨会》日程表:A.题目要求:使用表格标记和标记属性设计《网络主题研讨会》日程表。效果图如下:B.思路:【1】CSS样式:#div0:为主容器设置背景图片(images61-4.png),定义了宽度、高度和边距。#div1:为特定容器设置文本对齐、内边距和外边距。#div2:为另一个容器定义了宽度和高度。#schedule:样式化表格,设置字体、边框合并、宽度、边距和边框。
- Codeforces Round 919 div2 -- C -- Partitioning the Array -- 题解
Studying~
算法
目录C--PartitioningtheArray题目大意:思路解析:代码实现:C--PartitioningtheArray题目大意:给你一个长度为n的数组,你可以选择一个整数k,将数组均分为多个大小为k的子数组。如果你能找到一个整数m(m>=2),并将数组所有元素模上m,并且如果能使得子数组对应位置值相等,则得一分,问你最后这个数组总得分多少。思路解析:对于某些x和y,让我们试着找出所有的m,
- EDSR训练及测试教程
加斯顿工程师
深度学习超分辨率重建深度学习
EDSR训练及测试教程超分重建经典算法EDSR开源代码使用教程。论文名称:EnhancedDeepResidualNetworksforSingleImageSuper-Resolution,CVPR2017。训练自己的数据集由于EDSR开源代码只针对DIV2K数据集,在数据集加载时很多代码已经固定,因此在这里使用固定的文件结构,将图像数据复制到相应的文件夹即可进行训练数据集文件结构在主目录下新建
- 矩阵求逆(JAVA)利用伴随矩阵
qiuwanchi
利用伴随矩阵求逆矩阵
package gaodai.matrix;
import gaodai.determinant.DeterminantCalculation;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
/**
* 矩阵求逆(利用伴随矩阵)
* @author 邱万迟
- 单例(Singleton)模式
aoyouzi
单例模式Singleton
3.1 概述 如果要保证系统里一个类最多只能存在一个实例时,我们就需要单例模式。这种情况在我们应用中经常碰到,例如缓存池,数据库连接池,线程池,一些应用服务实例等。在多线程环境中,为了保证实例的唯一性其实并不简单,这章将和读者一起探讨如何实现单例模式。 3.2
- [开源与自主研发]就算可以轻易获得外部技术支持,自己也必须研发
comsci
开源
现在国内有大量的信息技术产品,都是通过盗版,免费下载,开源,附送等方式从国外的开发者那里获得的。。。。。。
虽然这种情况带来了国内信息产业的短暂繁荣,也促进了电子商务和互联网产业的快速发展,但是实际上,我们应该清醒的看到,这些产业的核心力量是被国外的
- 页面有两个frame,怎样点击一个的链接改变另一个的内容
Array_06
UIXHTML
<a src="地址" targets="这里写你要操作的Frame的名字" />搜索
然后你点击连接以后你的新页面就会显示在你设置的Frame名字的框那里
targerts="",就是你要填写目标的显示页面位置
=====================
例如:
<frame src=&
- Struts2实现单个/多个文件上传和下载
oloz
文件上传struts
struts2单文件上传:
步骤01:jsp页面
<!--在进行文件上传时,表单提交方式一定要是post的方式,因为文件上传时二进制文件可能会很大,还有就是enctype属性,这个属性一定要写成multipart/form-data,不然就会以二进制文本上传到服务器端-->
<form action="fileUplo
- 推荐10个在线logo设计网站
362217990
logo
在线设计Logo网站。
1、http://flickr.nosv.org(这个太简单)
2、http://www.logomaker.com/?source=1.5770.1
3、http://www.simwebsol.com/ImageTool
4、http://www.logogenerator.com/logo.php?nal=1&tpl_catlist[]=2
5、ht
- jsp上传文件
香水浓
jspfileupload
1. jsp上传
Notice:
1. form表单 method 属性必须设置为 POST 方法 ,不能使用 GET 方法
2. form表单 enctype 属性需要设置为 multipart/form-data
3. form表单 action 属性需要设置为提交到后台处理文件上传的jsp文件地址或者servlet地址。例如 uploadFile.jsp 程序文件用来处理上传的文
- 我的架构经验系列文章 - 前端架构
agevs
JavaScriptWeb框架UIjQuer
框架层面:近几年前端发展很快,前端之所以叫前端因为前端是已经可以独立成为一种职业了,js也不再是十年前的玩具了,以前富客户端RIA的应用可能会用flash/flex或是silverlight,现在可以使用js来完成大部分的功能,因此js作为一门前端的支撑语言也不仅仅是进行的简单的编码,越来越多框架性的东西出现了。越来越多的开发模式转变为后端只是吐json的数据源,而前端做所有UI的事情。MVCMV
- android ksoap2 中把XML(DataSet) 当做参数传递
aijuans
android
我的android app中需要发送webservice ,于是我使用了 ksop2 进行发送,在测试过程中不是很顺利,不能正常工作.我的web service 请求格式如下
[html]
view plain
copy
<Envelope xmlns="http://schemas.
- 使用Spring进行统一日志管理 + 统一异常管理
baalwolf
spring
统一日志和异常管理配置好后,SSH项目中,代码以往散落的log.info() 和 try..catch..finally 再也不见踪影!
统一日志异常实现类:
[java]
view plain
copy
package com.pilelot.web.util;
impor
- Android SDK 国内镜像
BigBird2012
android sdk
一、镜像地址:
1、东软信息学院的 Android SDK 镜像,比配置代理下载快多了。
配置地址, http://mirrors.neusoft.edu.cn/configurations.we#android
2、北京化工大学的:
IPV4:ubuntu.buct.edu.cn
IPV4:ubuntu.buct.cn
IPV6:ubuntu.buct6.edu.cn
- HTML无害化和Sanitize模块
bijian1013
JavaScriptAngularJSLinkySanitize
一.ng-bind-html、ng-bind-html-unsafe
AngularJS非常注重安全方面的问题,它会尽一切可能把大多数攻击手段最小化。其中一个攻击手段是向你的web页面里注入不安全的HTML,然后利用它触发跨站攻击或者注入攻击。
考虑这样一个例子,假设我们有一个变量存
- [Maven学习笔记二]Maven命令
bit1129
maven
mvn compile
compile编译命令将src/main/java和src/main/resources中的代码和配置文件编译到target/classes中,不会对src/test/java中的测试类进行编译
MVN编译使用
maven-resources-plugin:2.6:resources
maven-compiler-plugin:2.5.1:compile
&nbs
- 【Java命令二】jhat
bit1129
Java命令
jhat用于分析使用jmap dump的文件,,可以将堆中的对象以html的形式显示出来,包括对象的数量,大小等等,并支持对象查询语言。 jhat默认开启监听端口7000的HTTP服务,jhat是Java Heap Analysis Tool的缩写
1. 用法:
[hadoop@hadoop bin]$ jhat -help
Usage: jhat [-stack <bool&g
- JBoss 5.1.0 GA:Error installing to Instantiated: name=AttachmentStore state=Desc
ronin47
进到类似目录 server/default/conf/bootstrap,打开文件 profile.xml找到: Xml代码<bean
name="AttachmentStore"
class="org.jboss.system.server.profileservice.repository.AbstractAtta
- 写给初学者的6条网页设计安全配色指南
brotherlamp
UIui自学ui视频ui教程ui资料
网页设计中最基本的原则之一是,不管你花多长时间创造一个华丽的设计,其最终的角色都是这场秀中真正的明星——内容的衬托
我仍然清楚地记得我最早的一次美术课,那时我还是一个小小的、对凡事都充满渴望的孩子,我摆放出一大堆漂亮的彩色颜料。我仍然记得当我第一次看到原色与另一种颜色混合变成第二种颜色时的那种兴奋,并且我想,既然两种颜色能创造出一种全新的美丽色彩,那所有颜色
- 有一个数组,每次从中间随机取一个,然后放回去,当所有的元素都被取过,返回总共的取的次数。写一个函数实现。复杂度是什么。
bylijinnan
java算法面试
import java.util.Random;
import java.util.Set;
import java.util.TreeSet;
/**
* http://weibo.com/1915548291/z7HtOF4sx
* #面试题#有一个数组,每次从中间随机取一个,然后放回去,当所有的元素都被取过,返回总共的取的次数。
* 写一个函数实现。复杂度是什么
- struts2获得request、session、application方式
chiangfai
application
1、与Servlet API解耦的访问方式。
a.Struts2对HttpServletRequest、HttpSession、ServletContext进行了封装,构造了三个Map对象来替代这三种对象要获取这三个Map对象,使用ActionContext类。
----->
package pro.action;
import java.util.Map;
imp
- 改变python的默认语言设置
chenchao051
python
import sys
sys.getdefaultencoding()
可以测试出默认语言,要改变的话,需要在python lib的site-packages文件夹下新建:
sitecustomize.py, 这个文件比较特殊,会在python启动时来加载,所以就可以在里面写上:
import sys
sys.setdefaultencoding('utf-8')
&n
- mysql导入数据load data infile用法
daizj
mysql导入数据
我们常常导入数据!mysql有一个高效导入方法,那就是load data infile 下面来看案例说明
基本语法:
load data [low_priority] [local] infile 'file_name txt' [replace | ignore]
into table tbl_name
[fields
[terminated by't']
[OPTI
- phpexcel导入excel表到数据库简单入门示例
dcj3sjt126com
PHPExcel
跟导出相对应的,同一个数据表,也是将phpexcel类放在class目录下,将Excel表格中的内容读取出来放到数据库中
<?php
error_reporting(E_ALL);
set_time_limit(0);
?>
<html>
<head>
<meta http-equiv="Content-Type"
- 22岁到72岁的男人对女人的要求
dcj3sjt126com
22岁男人对女人的要求是:一,美丽,二,性感,三,有份具品味的职业,四,极有耐性,善解人意,五,该聪明的时候聪明,六,作小鸟依人状时尽量自然,七,怎样穿都好看,八,懂得适当地撒娇,九,虽作惊喜反应,但看起来自然,十,上了床就是个无条件荡妇。 32岁的男人对女人的要求,略作修定,是:一,入得厨房,进得睡房,二,不必服侍皇太后,三,不介意浪漫蜡烛配盒饭,四,听多过说,五,不再傻笑,六,懂得独
- Spring和HIbernate对DDM设计的支持
e200702084
DAO设计模式springHibernate领域模型
A:数据访问对象
DAO和资源库在领域驱动设计中都很重要。DAO是关系型数据库和应用之间的契约。它封装了Web应用中的数据库CRUD操作细节。另一方面,资源库是一个独立的抽象,它与DAO进行交互,并提供到领域模型的“业务接口”。
资源库使用领域的通用语言,处理所有必要的DAO,并使用领域理解的语言提供对领域模型的数据访问服务。
- NoSql 数据库的特性比较
geeksun
NoSQL
Redis 是一个开源的使用ANSI C语言编写、支持网络、可基于内存亦可持久化的日志型、Key-Value数据库,并提供多种语言的API。目前由VMware主持开发工作。
1. 数据模型
作为Key-value型数据库,Redis也提供了键(Key)和值(Value)的映射关系。除了常规的数值或字符串,Redis的键值还可以是以下形式之一:
Lists (列表)
Sets
- 使用 Nginx Upload Module 实现上传文件功能
hongtoushizi
nginx
转载自: http://www.tuicool.com/wx/aUrAzm
普通网站在实现文件上传功能的时候,一般是使用Python,Java等后端程序实现,比较麻烦。Nginx有一个Upload模块,可以非常简单的实现文件上传功能。此模块的原理是先把用户上传的文件保存到临时文件,然后在交由后台页面处理,并且把文件的原名,上传后的名称,文件类型,文件大小set到页面。下
- spring-boot-web-ui及thymeleaf基本使用
jishiweili
springthymeleaf
视图控制层代码demo如下:
@Controller
@RequestMapping("/")
public class MessageController {
private final MessageRepository messageRepository;
@Autowired
public MessageController(Mes
- 数据源架构模式之活动记录
home198979
PHP架构活动记录数据映射
hello!架构
一、概念
活动记录(Active Record):一个对象,它包装数据库表或视图中某一行,封装数据库访问,并在这些数据上增加了领域逻辑。
对象既有数据又有行为。活动记录使用直截了当的方法,把数据访问逻辑置于领域对象中。
二、实现简单活动记录
活动记录在php许多框架中都有应用,如cakephp。
<?php
/**
* 行数据入口类
*
- Linux Shell脚本之自动修改IP
pda158
linuxcentosDebian脚本
作为一名
Linux SA,日常运维中很多地方都会用到脚本,而服务器的ip一般采用静态ip或者MAC绑定,当然后者比较操作起来相对繁琐,而前者我们可以设置主机名、ip信息、网关等配置。修改成特定的主机名在维护和管理方面也比较方便。如下脚本用途为:修改ip和主机名等相关信息,可以根据实际需求修改,举一反三!
#!/bin/sh
#auto Change ip netmask ga
- 开发环境搭建
独浮云
eclipsejdktomcat
最近在开发过程中,经常出现MyEclipse内存溢出等错误,需要重启的情况,好麻烦。对于一般的JAVA+TOMCAT项目开发,其实没有必要使用重量级的MyEclipse,使用eclipse就足够了。尤其是开发机器硬件配置一般的人。
&n
- 操作日期和时间的工具类
vipbooks
工具类
大家好啊,好久没有来这里发文章了,今天来逛逛,分享一篇刚写不久的操作日期和时间的工具类,希望对大家有所帮助。
/*
* @(#)DataFormatUtils.java 2010-10-10
*
* Copyright 2010 BianJing,All rights reserved.
*/
package test;
impor