自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

加油哈

move move move

  • 博客(7)
  • 资源 (10)
  • 收藏
  • 关注

原创 汇编寻址与消除歧义 -- 汇编学习笔记(二)

学完了C语言来学汇编,有一个容易困惑的地方,那就是如何去访问一个变量,怎么对其进行修改,运算。 在C语言中,我们有两种方式,取值和取值,可以直接 a+b,也可以用*a+*b 但在汇编中,更底层的认识让我们明白所谓的取值只是C语言的一个解释,想访问一个非立即数的元素,唯一的方法就是寻址,我们多种方式的目的就是为了找到我们需要变量的物理地址。 直接寻址:存储器 名字容易让人

2009-11-04 21:12:00 556

原创 Linux c 学习笔记(一)

多文件编译 函数和变量可以多出声明  但是只能一处定义  首先, 尽管一个全局变量或函数可以 (在多个编译单元中) 有多处 ‘声明’, 但是 ‘定义’ 却只能允许出现一次。定义是分配空间并赋初值 (如果有) 的声明。最好的安排是在某个相关的 .c 文件中定义, 然后在头文件  (.h) 中进行外部声明, 在需要使用的时候, 只要包含对应的头文件即可。定义变量的 .c 文件也应该包含

2009-10-24 13:36:00 249

原创 SQL 学习笔记 (-)

SQL 语法特点:1 每个语句以;结束,中间用()包含,,间隔。2 对变量和常量等需要用()包含。3 关键字大写,变量名首大写字母用表名表征,然后用小写表征属性基本语句: DESC 表名查看表详细属性建表: CREATE TABLE 表名( 属性名 类型(约束)  主键(PRIMARY KEY)如果是域为主键 PRIMARY KEY(属性...属

2009-10-19 10:05:00 299

原创 matlab 学习笔记(1)

 N = 41;a = [0.8 -0.44 0.36 0.02];b = [1 0.7 -0.45 -0.6];x = [1 zeros(1,N-1)];k = 0:1:N-1;y = filter(a,b,x);   stem(k,y);xlabel(n);ylabel(幅度);运算目标:向量函数: conv 求卷积  conv(x,y)fi

2009-10-14 19:43:00 629

原创 汇编学习笔记 (1)

今天开始了王爽的汇编语言的学习。 我们能控制的只是cpu的寄存器,所以我们可以利用改变段基址和偏移量来寻找内存中有价值的信息,而段基址的性质决定其中保存的是什么样的信息。  运行: command  指令: add 相加赋值给前一个值 move 赋值 jmp 代码段中的赋值,相当于跳转。  debug: 对于寄存器: 查看,修改寄存器中信息 :

2009-10-04 11:54:00 339

转载 高效率 kosaraju+缩点 模板

#include #include #include using namespace std;#define init(l) memset(l,0,sizeof(l))#define N 101struct edge{ int dest; edge *next;};edge *G1[N],*G2[N],*G[N];int used[N],path

2009-08-24 22:37:00 358

原创 强连通分量 + 缩点 kosaraju

 #include #include using namespace std;#define MAXN 10005int n, m, cnt;//n是顶点数,m是边数,cnt是强连通分量的个数int belg[MAXN];//存储强连通分量,其中belg[i]表示顶点i属于第belg[i]个强连通分量int lTime[MAXN];//结束时间标记,其中numb[i

2009-08-24 21:46:00 780

51单片机+proteus逻辑分析仪,可选高低频率

用51单片机做的一个逻辑分析仪,用液晶显示,根据不同的频率,可以设定高低频率来采样。用proteus仿真实现。

2011-08-06

8AiBATIS+in+Action.pdf英文

1 The iBATIS philosophy 3 1.1 A hybrid solution: combining the best of the best 4 Exploring the roots of iBATIS 5 Understanding the iBATIS advantage 10 1.2 Where iBATIS fits 14 The business object model 15 ■ The presentation layer 15 The business logic layer 17 ■ The persistence layer 18 The relational database 19 1.3 Working with different database types 22 Application databases 22 ■ Enterprise databases 23 Proprietary databases 25 ■ Legacy databases 25 x CONTENTS 1.4 How iBATIS handles common database challenges 26 Ownership and control 26 ■ Access by multiple disparate systems 27 ■ Complex keys and relationships 28 ■ Denormalized or overnormalized models 29 ■ Skinny data models 30 1.5 Summary 32 2 What is iBATIS? 33 2.1 Mapping SQL 35 2.2 How it works 37 iBATIS for small, simple systems 38 iBATIS for large, enterprise systems 39 2.3 Why use iBATIS? 40 Simplicity 40 ■ Productivity 41 ■ Performance 41 Separation of concerns 42 ■ Division of labor 42 ■ Portability: Java, .NET, and others 42 ■ Open source and honesty 43 2.4 When not to use iBATIS 43 When you have full control…forever 43 ■ When your application requires fully dynamic SQL 44 ■ When you’re not using a relational database 44 ■ When it simply does not work 45 2.5 iBATIS in five minutes 45 Setting up the database 46 ■ Writing the code 46 ■ Configuring iBATIS (a preview) 47 ■ Building the application 49 Running the application 49 2.6 The future: where is iBATIS going? 50 Apache Software Foundation 50 ■ Simpler, smaller, with fewer dependencies 51 ■ More extensions and plug-ins 51 Additional platforms and languages 51 2.7 Summary 52 PART 2 IBATIS BASICS ................................................55 3 Installing and configuring iBATIS 57 3.1 Getting an iBATIS distribution 58 Binary distribution 59 ■ Building from source 59 3.2 Distribution contents 62 CONTENTS xi 3.3 Dependencies 62 Bytecode enhancement for lazy loading 63 ■ Jakarta Commons Database Connection Pool 63 ■ Distributed caching 64 3.4 Adding iBATIS to your application 64 Using iBATIS with a stand-alone application 64 Using iBATIS with a web application 65 3.5 iBATIS and JDBC 65 Releasing JDBC resources 66 ■ SQL injection 66 Reducing the complexity 67 3.6 iBATIS configuration continued 68 The SQL Map configuration file 69 ■ The <properties> element 70 The <settings> element 71 ■ The <typeAlias> elements 73 ■ The <transactionManager> element 75 ■ The <typeHandler> element 77 ■ The <sqlMap> element 78 3.7 Summary 78 4 Working with mapped statements 80 4.1 Starting with the basics 81 Creating JavaBeans 81 ■ The SqlMap API 85 Mapped statement types 86 4.2 Using <select> mapped statements 89 Using inline parameters with the # placeholders 89 ■ Using inline parameters with the $ placeholders 91 ■ A quick look at SQL injection 92 ■ Automatic result maps 93 Joining related data 95 4.3 Mapping parameters 95 External parameter maps 95 ■ Inline parameter mapping revisited 97 ■ Primitive parameters 99 JavaBean and Map parameters 99 4.4 Using inline and explicit result maps 100 Primitive results 101 ■ JavaBean and Map results 102 4.5 Summary 103 5 Executing nonquery statements 105 5.1 The building blocks for updating data 106 The SqlMap API for nonquery SQL statements 106 Nonquery mapped statements 107 xii CONTENTS 5.2 Inserting data 108 Using inline parameter mapping 108 ■ Using an external ■ parameter map 109 ■ Autogenerated keys 110 5.3 Updating and deleting data 113 Handling concurrent updates 114 Updating or deleting child records 114 5.4 Running batch updates 115 5.5 Working with stored procedures 117 Considering the pros and cons 117 IN, OUT, and INOUT parameters 119 5.6 Summary 121 6 Using advanced query techniques 122 6.1 Using XML with iBATIS 123 XML parameters 123 ■ XML results 125 6.2 Relating objects with mapped statements 128 Complex collections 128 ■ Lazy loading 131 Avoiding the N+1 Selects problem 132 6.3 Inheritance 134 Mapping Inheritance 136 6.4 Other miscellaneous uses 137 Using the statement type and DDL 137 Processing extremely large data sets 138 6.5 Summary 144 7 Transactions 145 7.1 What is a transaction? 146 A simple banking example 146 Understanding transaction properties 148 7.2 Automatic transactions 151 7.3 Local transactions 152 7.4 Global transactions 153 Using active or passive transactions 154 ■ Starting, committing, and ending the transaction 155 ■ Do I need a global transaction? 156 7.5 Custom transactions 156 CONTENTS xiii 7.6 Demarcating transactions 158 Demarcating transactions at the presentation layer 159 Demarcating transactions at the persistence layer 160 Demarcating transactions at the business logic layer 160 7.7 Summary 161 8 Using Dynamic SQL 163 8.1 Dealing with Dynamic WHERE clause criteria 164 8.2 Getting familiar with the dynamic tags 166 The <dynamic> tag 168 ■ Binary tags 169 ■ Unary tags 171 Parameter tags 172 ■ The <iterate> tag 173 8.3 A complete simple example 175 Defining how to retrieve and display data 176 ■ Determining which database structures are involved 176 ■ Writing the SQL in static format 176 ■ Applying Dynamic SQL tags to static SQL 177 8.4 Advanced Dynamic SQL techniques 178 Defining the resulting data 178 ■ Defining the required input 179 Writing the SQL in static format 180 ■ Applying Dynamic SQL tags to static SQL 181 8.5 Alternative approaches to Dynamic SQL 183 Using Java code 184 ■ Using stored procedures 187 Comparing to iBATIS 189 8.6 The future of Dynamic SQL 190 Simplified conditional tags 190 ■ Expression language 191 8.7 Summary 191 PART 3 IBATIS IN THE REAL WORLD .........................193 9 Improving performance with caching 195 9.1 A simple iBATIS caching example 196 9.2 iBATIS’s caching philosophy 197 9.3 Understanding the cache model 198 Type 198 ■ The readOnly attribute 199 ■ The serialize attribute 199 ■ Combining readOnly and serialize 200 xiv CONTENTS 9.4 Using tags inside the cache model 201 Cache flushing 201 Setting cache model implementation properties 204 9.5 Cache model types 204 MEMORY 205 ■ LRU 206 ■ FIFO 207 ■ OSCACHE 208 Your cache model here 208 9.6 Determining a caching strategy 208 Caching read-only, long-term data 209 ■ Caching read-write data 211 ■ Caching aging static data 213 9.7 Summary 216 10 iBATIS data access objects 217 10.1 Hiding implementation details 218 Why the separation? 219 ■ A simple example 220 10.2 Configuring the DAO 223 The <properties> element 223 ■ The <context> element 223 The <transactionManager> element 224 ■ The DAO elements 229 10.3 Configuration tips 230 Multiple servers 230 ■ Multiple database dialects 231 Runtime configuration changes 232 10.4 A SQL Map DAO implementation example 233 Configuring the DAO in iBATIS 234 ■ Creating a DaoManager instance 235 ■ Defining the transaction manager 235 ■ Loading the maps 236 ■ Coding the DAO implementation 239 10.5 Summary 241 11 Doing more with DAO 242 11.1 Non-SQLMap DAO implementations 243 A Hibernate DAO implementation 243 A JDBC DAO implementation 248 11.2 Using the DAO pattern with other data sources 253 Example: using a DAO with LDAP 253 Example: using a DAO with a web service 258 11.3 Using the Spring DAO 260 Writing the code 260 ■ Why use Spring instead of iBATIS? 262 CONTENTS xv 11.4 Creating your own DAO layer 262 Separating interface from implementation 263 Decoupling and creating a factory 263 11.5 Summary 266 12 Extending iBATIS 267 12.1 Understanding pluggable component design 268 12.2 Working with custom type handlers 269 Implementing a custom type handler 270 Creating a TypeHandlerCallback 271 Registering a TypeHandlerCallback for use 275 12.3 Working with a CacheController 276 Creating a CacheController 277 ■ Putting, getting, and flushing a CacheController 277 ■ Registering a CacheController for use 278 12.4 Configuring an unsupported DataSource 279 12.5 Customizing transaction management 280 Understanding the TransactionConfig interface 281 Understanding the Transaction interface 282 12.6 Summary 283 PART 4 IBATIS RECIPES ...........................................285 13 iBATIS best practices 287 13.1 Unit testing with iBATIS 288 Unit-testing the mapping layer 288 ■ Unit-testing data access objects 291 ■ Unit-testing DAO consumer layers 293 13.2 Managing iBATIS configuration files 295 Keep it on the classpath 295 ■ Keep your files together 297 Organize mostly by return type 298 13.3 Naming conventions 298 Naming statements 298 ■ Naming parameter maps 298 Naming result maps 299 ■ XML files 299 13.4 Beans, maps, or XML? 300 JavaBeans 300 ■ Maps 300 ■ XML 301 ■ Primitives 301 13.5 Summary 301 xvi CONTENTS 14 Putting it all together 303 14.1 Design concept 304 Account 304 ■ Catalog 304 ■ Cart 305 ■ Order 305 14.2 Choosing technologies 305 Presentation 305 ■ Service 305 ■ Persistence 306 14.3 Tweaking Struts: the BeanAction 306 BeanBase 307 ■ BeanAction 307 ■ ActionContext 307 14.4 Laying the foundation 308 src 308 ■ test 309 ■ web 309 build 310 ■ devlib 310 ■ lib 310 14.5 Configuring the web.xml 311 14.6 Setting up the presentation 312 The first step 312 ■ Utilizing a presentation bean 315 14.7 Writing your service 320 Configuring dao.xml 321 ■ Transaction demarcation 322 14.8 Writing the DAO 323 SQLMap configuration 324 ■ SQLMap 325 Interface and implementation 326 14.9 Summary 328 appendix iBATIS.NET Quick Start

2011-05-26

JSP万年历 JSP万年历

带有备忘录的万年历 <% days = new String[42]; for (int i = 0; i <% GregorianCalendar currentDay = new GregorianCalendar(); int today = currentDay.get(Calendar.DAY_OF_MONTH); int month = currentDay.get(Calendar.MONTH); int year = currentDay.get(Calendar.YEAR); if (request.getParameter("month") != null && request.getParameter("year") != null) { int requestMonth = Integer.parseInt(request.getParameter("month")); int requestYear = Integer.parseInt(request.getParameter("year")); if (requestYear == currentDay.get(Calendar.YEAR) && requestMonth == month) {} else if (requestMonth == -1) { month = 11; year = requestYear - 1; } else if (requestMonth == 12) { month = 0; year = requestYear + 1; } else { month = requestMonth; year = requestYear; } } Calendar thisMonth = Calendar.getInstance(); thisMonth.set(Calendar.MONTH, month); thisMonth.set(Calendar.YEAR, year); thisMonth.setFirstDayOfWeek(Calendar.SUNDAY); thisMonth.set(Calendar.DAY_OF_MONTH, 1); int firstIndex = thisMonth.get(Calendar.DAY_OF_WEEK) - 1; int maxIndex = thisMonth.getActualMaximum(Calendar.DAY_OF_MONTH); for (int i = 0; i <% String allShowTime = year + "." + month + "." + today + "." + currentDay.get(Calendar.HOUR_OF_DAY) + "." + currentDay.ge

2011-05-26

keil+proteus 实现的电子钟+温度+液晶显示

用51在proteus上实现在 时钟和温度用12864液晶显示,时钟芯片ds1302.温度芯片DS18B20.

2011-05-20

数据库大作业 课程设计 sql 多个文档终极版

里面有多个数据库的文档 (6个) sql 包括 毕业设计安排,网店,教室,图书馆,仓库等。

2009-12-23

清华数据结构全套(下)

收集的 <br>数据结构(严蔚敏)演示系统<br>数据结构【C语言版严蔚敏著】 电子书<br>清华大学数据结构讲义 课件<br>严数据结构答案 <br><br><br>方便大家不用再一次查找...

2008-02-03

清华数据结构全套(上)

收集的 <br>数据结构(严蔚敏)演示系统<br>数据结构【C语言版严蔚敏著】 电子书<br>清华大学数据结构讲义 课件<br>严数据结构答案 <br><br><br>方便大家不用再一次查找...

2008-02-03

谭老师c语言 指针笔记

对指针章里习题的练习,错误,和总结... 希望对大家也能有所帮助...

2008-01-30

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除