LESS 语法备忘

解决多版本的动画函数

在新版本下

.vendor(@property, @value) {
    -webkit-@{property}: @value;
     -khtml-@{property}: @value;
       -moz-@{property}: @value;
            @{property}: @value;
}
// 重载函数
.vendor(@property, @value, @value2) {
    -webkit-@{property}: @value, @value2;
     -khtml-@{property}: @value, @value2;
       -moz-@{property}: @value, @value2;
            @{property}: @value, @value2;
}

.keyframes (@name, @frames) {
	@-webkit-keyframes @name { @frames(); }
       @-moz-keyframes @name { @frames(); }
        @-ms-keyframes @name { @frames();}
         @-o-keyframes @name { @frames(); }
            @keyframes @name { @frames(); }
}

// 例子
.keyframes (line, {
    0%{background-size:0% 2px;}
    100%{background-size:100% 2px;}
});

声明变量

@baseColor: red;

div{
   color:@color;
}

为了生成互补色,我们使用 spin 将颜色旋转 180 度:

/* Mixin */
@base: #663333;
@complement1: spin(@base, 180);
@complement2: darken(spin(@base, 180), 5%);
@lighten1: lighten(@base, 15%);
@lighten2: lighten(@base, 30%);

/* Implementation */
.one   {color: @base;}
.two   {color: @complement1;}
.three {color: @complement2;}
.four  {color: @lighten1;}
.five  {color: @lighten2;}

注意 LESS 内置函数可以嵌套的。

/* 颜色微调 Subtle Color Scheme */
@base: #663333;
@lighter1: lighten(spin(@base, 5), 10%);
@lighter2: lighten(spin(@base, 10), 20%);
@darker1: darken(spin(@base, -5), 10%);
@darker2: darken(spin(@base, -10), 20%);

/* Implementation */
.one   {color: @base;}
.two   {color: @lighter1;}
.three {color: @lighter2;}
.four  {color: @darker1;}
.five  {color: @darker2;}

虽然 LESS 很早就支持字符类型的变量,如 @assetFilePath: "http://127.0.0.1/yueyun/asset/images"; 但使用却是一个问题,比如设置背景色的时候 url(@assetFilePath/bg.gif) 将不能正常解析。于是,在 LESS 的新版本中,提出了 "@{assetFilePath}" 的使用字符变量的方式。注意两侧的双引号 "" 不能缺少。如下的使用是合法的。

@assetFilePath: "http://127.0.0.1/yueyun/asset/images";
#logo {
    background: url("@{assetFilePath}/default_4.gif") no-repeat;
    height: 39px;
    width: 260px;
    margin-top: 22px;
    margin-left: 12px;
}

HEX 颜色转换为 RGB 用于背景颜色:background-color: rgba(red(@mainColor), green(@mainColor), blue(@mainColor), 0.5);

radius/shadow/transition/transform

/* 边角 */
.border-radius (@radius: 5px) {
    -webkit-border-radius: @radius;
    -moz-border-radius: @radius;
    border-radius: @radius;
}

/* Implementation */
#somediv {
    .border-radius(20px);
}
.backgroundSize(@size:contain){
    -webkit-background-size: @size; // 某些android 例如 Ophone 要加上 -webkit 的前缀
       -moz-background-size: @size;
          -ms-background-size: @size;
           -o-background-size: @size;
            background-size: @size;
}
/*
    盒子阴影
    @right_left 右边阴影为正数 左边负数
    @bottom_top 下边阴影为正数 上边负数
    @box 阴影大小
    @box_color 阴影颜色
*/
.boxshadow(@right_left:5px, @bottom_top:5px, @box:5px, @box_color:gray){
   -webkit-box-shadow: @arguments;
      -moz-box-shadow: @arguments;
       -ms-box-shadow: @arguments;
        -o-box-shadow: @arguments;
           box-shadow: @arguments;
}

/*
    文字阴影,可以指定多组阴影
    @right_left1 右边阴影为正数 左边负数
    @bottom_top1 下边阴影为正数 上边负数
    @text 阴影大小
    @text_color 阴影颜色
*/
.textshadow(@right_left1:5px, @bottom_top1:5px, @text:5px, @tetx_color:#b6ebf7){
    text-shadow:@arguments;
}
.transition(@t){    
    -webkit-transition: @t;
      -moz-transition: @t;
       -ms-transition: @t;
       -o-transition: @t;
         transition: @t;
}
/* 过渡 */
.transition (@prop: all, @time: 1s, @ease: linear) {
    -webkit-transition: @prop @time @ease;
    -moz-transition: @prop @time @ease;
    -o-transition: @prop @time @ease;
    -ms-transition: @prop @time @ease;
    transition: @prop @time @ease;
}

/* Implementation */
#somediv {
    .transition(all, 0.5s, ease-in);
} 

#somediv:hover {
    opacity: 0;
}

/* 旋转 */
.transform (@rotate: 90deg, @scale: 1, @skew: 1deg, @translate: 10px) {
    -webkit-transform: rotate(@rotate) scale(@scale) skew(@skew) translate(@translate);
    -moz-transform: rotate(@rotate) scale(@scale) skew(@skew) translate(@translate);
    -o-transform: rotate(@rotate) scale(@scale) skew(@skew) translate(@translate);
    -ms-transform: rotate(@rotate) scale(@scale) skew(@skew) translate(@translate);
    transform: rotate(@rotate) scale(@scale) skew(@skew) translate(@translate);
}

/* Implementation */
#someDiv {
    .transform(5deg, 0.5, 1deg, 0px);
}

Eclipse 下安装 LESS 插件:http://www.normalesup.org/~simonet/soft/ow/eclipse-less.fr.html

动态 LESS 样式:

URL 如:http://192.168.1.92/lessService/?isdebug=true&ns=C:/work/eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/yuetv_wap/asset/less&lessFile=C:/work/eclipse/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/yuetv_wap/asset/less/yuetv_wap.less&picPath=http://localhost:8080/yuetv_wap/asset/images/1/&MainDomain=http://192.168.1.92:8080/yuetv_wap

其中

  • 参数 isDebug = true 为调试阶段,不压缩 CSS 输出;当 isDebug = false 时候,压缩 CSS 输出。
  • 参数 ns 为命名空间之目录名,LESS 会在此目录下自动加入 LESS 而无须加上 目录前缀。通常为项目的 LESS 总目录,该目录下游多个 LESS 文件
  • 参数 lessFile 就是要解析的 LESS 文件名全称
  • 参数 picPath 是背景图的所在目录。开发阶段和线上的部署阶段的目录会有所不同。

Notepad++ 插件

<NotepadPlus>
    <UserLang name="LESS" ext="less" udlVersion="2.1">
        <Settings>
            <Global caseIgnored="no" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
            <Prefix Keywords1="no" Keywords2="no" Keywords3="yes" Keywords4="no" Keywords5="yes" Keywords6="no" Keywords7="yes" Keywords8="yes" />
        </Settings>
        <KeywordLists>
            <Keywords name="Comments">00// 01 02 03/* 04*/</Keywords>
            <Keywords name="Numbers, prefix1"></Keywords>
            <Keywords name="Numbers, prefix2">#</Keywords>
            <Keywords name="Numbers, extras1">A B C D E F a b c d e f</Keywords>
            <Keywords name="Numbers, extras2"></Keywords>
            <Keywords name="Numbers, suffix1"></Keywords>
            <Keywords name="Numbers, suffix2">% px em ex ch rem vw vh vmin vmax cm mm in pt pc</Keywords>
            <Keywords name="Numbers, range"></Keywords>
            <Keywords name="Operators1">' [ ] = ( ) , : ; { } + / * > ! ~</Keywords>
            <Keywords name="Operators2">-</Keywords>
            <Keywords name="Folders in code1, open"></Keywords>
            <Keywords name="Folders in code1, middle"></Keywords>
            <Keywords name="Folders in code1, close"></Keywords>
            <Keywords name="Folders in code2, open"></Keywords>
            <Keywords name="Folders in code2, middle"></Keywords>
            <Keywords name="Folders in code2, close"></Keywords>
            <Keywords name="Folders in comment, open"></Keywords>
            <Keywords name="Folders in comment, middle"></Keywords>
            <Keywords name="Folders in comment, close"></Keywords>
            <Keywords name="Keywords1">align align-content align-items align-self animation animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function attr azimuth backface-visibility background background-attachment background-clip background-color background-image background-origin background-position background-repeat background-size border border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-collapse border-color border-image border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-left border-left-color border-left-style border-left-width border-radius border-right border-right-color border-right-style border-right-width border-spacing border-style border-top border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-width bottom box-decoration-break box-shadow box-sizing break-after break-before break-inside calc caption-side clear clip clip-path color column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width columns content counter-increment counter-reset cross-fade cubic-bezier cue cue-after cue-before cursor cycle direction display element elevation empty-cells filter flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap float font font-family font-feature-settings font-kerning font-language-override font-size font-size-adjust font-stretch font-style font-variant font-variant-ligatures font-weight height hsl hsla hyphens icon image image-orientation image-rendering image-resolution ime-mode inherit initial justify-content left letter-spacing line-height linear-gradient list-style list-style-image list-style-position list-style-type margin margin-bottom margin-left margin-right margin-top marker-offset marks mask matrix matrix3d max-height max-width min-height min-width nav-down nav-index nav-left nav-right nav-up  object-fit object-position opacity order orphans outline outline-color outline-offset outline-style outline-width overflow overflow-wrap overflow-x overflow-y padding padding-bottom padding-left padding-right padding-top page page-break-after page-break-before page-break-inside pause pause-after pause-before perspective perspective-origin pitch pitch-range play-during pointer-events position quotes radial-gradient rect repeating-linear-gradient repeating-radial-gradient resize rgb rgba richness right rotate rotate3d rotateX rotateY rotateZ scale scale3d scaleX scaleY scaleZ size skew skewX skewY speak speak-header speak-numeral speak-punctuation speech-rate steps stress tab-size table-layout text-align text-align-last text-combine-horizontal text-decoration text-decoration-color text-decoration-line text-decoration-style text-indent text-orientation text-overflow text-rendering text-shadow text-transform text-underline-position top transform transform-origin transform-style transition transition-delay transition-duration transition-property transition-timing-function translate translate3d translateX translateY translateZ unicode-bidi url var vertical-align visibility voice-family volume white-space widows width word-break word-spacing word-wrap writing-mode z-index

-epub-caption-side -epub-hyphens -epub-text-combine -epub-text-emphasis -epub-text-emphasis-color -epub-text-emphasis-style -epub-text-orientation -epub-text-transform -epub-word-break -epub-writing-mode -wap-accesskey -wap-input-format -wap-input-required -wap-marquee-dir -wap-marquee-loop -wap-marquee-speed -wap-marquee-style -xv-interpret-as -xv-phonemes -xv-voice-balance -xv-voice-duration -xv-voice-pitch -xv-voice-pitch-range -xv-voice-rate -xv-voice-stress -xv-voice-volume align-items align-self animation animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function backface-visibility background-clip background-origin background-position-x background-position-y background-size border-bottom-left-radius border-bottom-right-radius border-image border-radius border-top-left-radius border-top-right-radius box-decoration-break box-shadow box-sizing caption-side clip-path column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width columns filter flex flex-basis flex-direction flex-grow flex-shrink font-feature-settings ime-mode justify-content line-break mask opacity order overflow-x overflow-y perspective perspective-origin ruby-position scrollbar-arrow-color scrollbar-base-color scrollbar-darkshadow-color scrollbar-face-color scrollbar-highlight-color scrollbar-shadow-color scrollbar-track-color tab-size text-overflow text-transform transform transform-origin transform-style transition transition-delay transition-duration transition-property transition-timing-function word-break word-wrap writing-mode zoom</Keywords>
            <Keywords name="Keywords2">active after before checked choices  dir disabled empty enabled first first-child first-letter first-line first-of-type focus fullscreen hover indeterminate in-range invalid lang last-child last-of-type left link not nth-child nth-last-child nth-last-of-type nth-of-type only-child only-of-type optional out-of-range read-only read-write repeat-index repeat-item required right root scope selection target valid value visited</Keywords>
            <Keywords name="Keywords3"># .</Keywords>
            <Keywords name="Keywords4">@charset @document @font-face @import @keyframes @media @namespace @page @supports @viewport</Keywords>
            <Keywords name="Keywords5">@</Keywords>
            <Keywords name="Keywords6">& a abbr acronym address applet area article aside audio b base basefont bdi bdo bgsound big blink blockquote body br button canvas caption center cite code col colgroup command data datalist dd del details dfn dir div dl dt em embed fieldset figcaption figure font footer form frame frameset h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe img input ins isindex kbd keygen label legend li link listing main map mark marquee menu meta meter nav nobr noframes noscript object ol optgroup option output p param plaintext pre progress q rp rt ruby s samp script section select small source spacer span strike strong style sub summary sup table tbody td textarea tfoot th thead time title tr track tt u ul var video wbr xmp</Keywords>
            <Keywords name="Keywords7">&. a. abbr. acronym. address. applet. area. article. aside. audio. b. base. basefont. bdi. bdo. bgsound. big. blink. blockquote. body. br. button. canvas. caption. center. cite. code. col. colgroup. command. data. datalist. dd. del. details. dfn. dir. div. dl. dt. em. embed. fieldset. figcaption. figure. font. footer. form. frame. frameset. h1. h2. h3. h4. h5. h6. head. header. hgroup. hr. html. i. iframe. img. input. ins. isindex. kbd. keygen. label. legend. li. link. listing. main. map. mark. marquee. menu. meta. meter. nav. nobr. noframes. noscript. object. ol. optgroup. option. output. p. param. plaintext. pre. progress. q. rp. rt. ruby. s. samp. script. section. select. small. source. spacer. span. strike. strong. style. sub. summary. sup. table. tbody. td. textarea. tfoot. th. thead. time. title. tr. track. tt. u. ul. var. video. wbr. xmp.

&# a# abbr# acronym# address# applet# area# article# aside# audio# b# base# basefont# bdi# bdo# bgsound# big# blink# blockquote# body# br# button# canvas# caption# center# cite# code# col# colgroup# command# data# datalist# dd# del# details# dfn# dir# div# dl# dt# em# embed# fieldset# figcaption# figure# font# footer# form# frame# frameset# h1# h2# h3# h4# h5# h6# head# header# hgroup# hr# html# i# iframe# img# input# ins# isindex# kbd# keygen# label# legend# li# link# listing# main# map# mark# marquee# menu# meta# meter# nav# nobr# noframes# noscript# object# ol# optgroup# option# output# p# param# plaintext# pre# progress# q# rp# rt# ruby# s# samp# script# section# select# small# source# spacer# span# strike# strong# style# sub# summary# sup# table# tbody# td# textarea# tfoot# th# thead# time# title# tr# track# tt# u# ul# var# video# wbr# xmp#
</Keywords>
            <Keywords name="Keywords8">-moz- -ms- -o- -webkit- -apple- -khtml-</Keywords>
            <Keywords name="Delimiters">00' 01 02' 03" 04 05" 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23</Keywords>
        </KeywordLists>
        <Styles>
            <WordsStyle name="DEFAULT" fgColor="DCCDCD" bgColor="2A211C" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="COMMENTS" fgColor="6A6A6A" bgColor="2A211C" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="LINE COMMENTS" fgColor="6A6A6A" bgColor="2A211C" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="NUMBERS" fgColor="88F788" bgColor="2A211C" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS1" fgColor="C1BB71" bgColor="2A211C" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS2" fgColor="FCE383" bgColor="2A211C" colorStyle="1" fontName="" fontStyle="4" nesting="0" />
            <WordsStyle name="KEYWORDS3" fgColor="CA7473" bgColor="008000" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS4" fgColor="E6E6E6" bgColor="2A211C" colorStyle="2" fontName="" fontStyle="1" nesting="0" />
            <WordsStyle name="KEYWORDS5" fgColor="68A9EA" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS6" fgColor="FF8080" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS7" fgColor="FF8080" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS8" fgColor="C1BB71" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="OPERATORS" fgColor="E9E9E9" bgColor="2A211C" fontName="" fontStyle="1" nesting="0" />
            <WordsStyle name="FOLDER IN CODE1" fgColor="C1BB71" bgColor="2A211C" colorStyle="1" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="FOLDER IN CODE2" fgColor="000000" bgColor="FFFFFF" colorStyle="0" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="FOLDER IN COMMENT" fgColor="000000" bgColor="FFFFFF" colorStyle="0" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS1" fgColor="D4A23B" bgColor="2A211C" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS2" fgColor="D4A23B" bgColor="2A211C" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS3" fgColor="FFFFFF" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="50339852" />
            <WordsStyle name="DELIMITERS4" fgColor="FF0080" bgColor="FFFFFF" colorStyle="1" fontName="" fontStyle="0" nesting="50592900" />
            <WordsStyle name="DELIMITERS5" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS6" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS7" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
        </Styles>
    </UserLang>
</NotepadPlus>

if 语句

没有直接的 if 语句,而是 when(xxx){}

/*
	区域内局部滚动
	控制元素在移动设备上是否使用滚动回弹效果.
	看上去和原生app的效率都有得一拼,要实现这个效果很简单,只需要加一行css代码即可:-webkit-overflow-scrolling : touch;
	结构如下,必须三层
	div.areaScroll > ul > li
*/
.areaScroll(@direct: hoz){
	-webkit-overflow-scrolling : touch;
	overflow : hidden;

	/* overflow-x|y : auto;  */
	& when (@direct = hoz) {
		overflow-x : auto;
		white-space:nowrap;
	}
	& when (@direct = v) {
		overflow-y : auto;
	}
	&>ul{
		&>li{
			float: none; /* 不能 float:left */
			display:inline-block;
		}
	}
}
时间: 2024-10-16 00:04:17

LESS 语法备忘的相关文章

markdown语法备忘笔记

1. 什么是markdown 2. 我选择的markdown编辑器 首先选择适合自己的markdown编辑器需要考虑几个方面: 平台:Mac OS X, Windows, Online, 插件形式 预览:实时预览.html预览 语法:选定某一款后,适应自己的习惯,不必太复杂 其它:如主题,快捷键,同步等 首先来说一下以下几款为什么我没选用:(纯属个人喜好) Sublime Text的插件markdown preview,编辑和预览是分离的,在浏览器里预览. CuteMarkEd,独立编辑器,支持

Markdown语法备忘_其它综合

Markdown编辑器 Windows:   1. MarkdownPad   2. MarkPad Mac:   *Mou Linux:   * ReText Markdown语法 1.标题 复制代码 代码如下: # H1 <一级标题> ## H2<二级标题> 依次类推,直到 ###### H6<六级标题> 注意:#号和文字之间要有一个空格 2.文字格式 复制代码 代码如下: **文字粗体格式** --->在要加粗的文字左右各加两个*(星号) *文字斜体格式*-

Express模版引擎hbs备忘

最近几天折腾了下express,想找个合适的模版引擎,下面是一些折腾过程的备忘 选择标准 选择一门模版语言时,可能会考虑的几点 语法友好(micro tmpl那种语法真是够了) 支持模版嵌套(子模版的概念) 支持模版继承(extend) 前后端共用 有容错处理(最好定位到具体出错位置) 支持预编译(性能好) 注意到hbs,似乎满足大部分的需求:https://github.com/donpark/hbs getting started demo地址:https://github.com/chyi

Cheat—— 给Linux初学者和管理员一个终极命令行&quot;备忘单&quot;

Cheat-- 给Linux初学者和管理员一个终极命令行"备忘单" 当你不确定你所运行的命令,尤其是那些使用了许多选项的复杂命令时,你会怎么做?在这种情况下,我们使用man pages来获取帮助.还有一些其它的选择可能包括像'help','whereis'和'whatis'这样的命令.但是所有的这些既有优点,也有缺点. 当我们浏览man pages来查看选项和帮助的时候,里面的描述实在太冗长了,我们无法在短的时间里理解它的意思. Linux Man Pages Linux Man Pa

Python中利用函数装饰器实现备忘功能_python

"备忘"的定义 "memoization"(备忘)这个词是由Donald Michie在1968年提出的,它基于拉丁语单词"memorandum"(备忘录),意思是"被记住".虽然它和单词"memorization"在某种程度上有些相似,但它并不是该单词的错误拼写.实际上,Memoisation是一种用于通过计算来加速程序的技术,它通过记住输入量的计算结果,例如函数调用结果,来实现其加速目的.如果遇到相同的

在Eclipse中构建备忘单

Eclipse提供了一种用于显示迷你型指南的内置机制,称为备忘单(cheat sheet).备忘单可以快速而有效地指导您如何在Eclipse中执行包含多个步骤的过程,它显示在工作台的边角处,您可以容易且快速地查看它们. 本教程演示了如何为Eclipse构造备忘单.构造完毕之后,它们还可以运行在BEA Workshop Studio.BEA Workshop for WebLogic和其他任何Eclipse系统之上,或许能对您现有的工具和插件进行补充.示例下载中提供了3个准备好的备忘单,其中一个备

Oracle数据库如何手动恢复备忘日志

最近因为升级了Mac os x 10.10 Yosemite,突然前几天的一个晚上,开机发现就停留在开机界面了,看来BETA果然是不靠谱,然后想到自己这不前几天刚备份完吗,没事,TimeMachine是何等神器,二话不说直接恢复.但是恢复完,我后悔了,一来是忘了昨天晚上还加班呢,加班的成功保留成果所剩无几,关键我这才发现TimeMachine既然不备份虚拟机文件(虚拟机文件30G,估计直接给略过了吧),难怪每次都觉得备份那么快. 不过后悔也没用,重新搭开发环境吧.操作系统WIN7->开发工具VS

JDBC事务编程模型备忘

在Spring一统天下的情况下,JDBC快没有生存余地了.不过JDBC还是Java操作数据库的基础,现在Java项目中JDBC的应用快绝迹了,有必要对JDBC的事务编程模型做个象征性的总结. 下面是示例,保证代码可以编译,但不保证能运行,呵呵. import java.sql.*; /** * JDBC编程事务控制模型备忘 * * @author : leizhimin,2008-8-21 14:48:42.<p> */ public class JdbcTxText { public sta

服务器迁移之debian重新配置Web服务的一些细节备忘

这次服务系统采用的是最新的Debian 7.0,但是有几个细节的忽略导致我折腾了一番,我再这里再做个记录吧   之前配置Linux服务器时采用的是Debian系统一直很稳定,这次准备迁移到新的服务器环境上,好在以前的配置我在博客都做了备忘,所以很容易就搞定了,这次服务系统采用的是最新的Debian 7.0,但是有几个细节的忽略导致我折腾了一番,我再这里再做个记录吧: 首先要安装编译环境,虽然我们通过apt-get可以方便的绕过手动编译的环节,但是一些程序包可能内置编译命令,可以编译一些扩展程序,