自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(12)
  • 资源 (92)
  • 收藏
  • 关注

原创 Java多线程中的生产者消费者模型

本文利用Java程序,实现一个多线程中的经典问题:生产者-消费者。首先定义一个Buffer 类,生产者向这个Buffer里放产品(泛型定义),消费者从这个Buffer里取产品。如果Buffer满了,生产者等待;如果Buffer空了,消费者等待。在主程序里,把Buffer的大小设置为10,启动了3个生产者,2个消费者,生产者生产一个产品需要1秒,消费者消费一个产品也需要一秒,运行30秒后,主

2016-06-10 22:51:30 945

原创 JAVA NIO 编写 Scoket 服务改进版

前几天用java NIO 编写了一个socket  服务器的例子,文章连接:http://blog.csdn.net/xidianliuy/article/details/51612676但是,这个例子有点缺陷:1)用户输入的文本长度有限制,最长为 BUFFER_SIZE 长度。2)ByteBuffer[] processInput(ByteBuffer bf, String ms

2016-06-10 14:11:53 703

原创 Java NIO编写Socket服务器的一个例子

Java中编写Socket服务器,通常有一下几种模式:1. 一个链接一个线程;优点:程序编写简单; 缺点:如果链接非常多,分批的线程会非常多,机器可能资源耗尽而崩溃。2.把每一个新链接,交接给一个固定数量的连接池;优点:程序编写相对简单,可以处理大量的链接。确定:线程的开销非常大,链接很多的情况,排队现象会比较严重。3. 使用Java中NIO,用异步IO方式处理。这种模式,可以用一个线

2016-06-08 14:02:18 10693 1

原创 JAVA中字符编码研究

本文介绍字符编码转换问题。基本概念编码过程,字符串 strA 经过某个字符集 (charset) 编码后成二进制数据 (byte[]  binA)。 对应java 中就是: byte[] binA = strA.getBytes(charset).解码过程,二进制数据 byte[] binA,经过字符集(charset)解码,还原成字符串strA。对应java中就是: Stri

2016-06-04 09:09:40 929

原创 Java中write(int)和writeInt(int)的区别,writeBytes(String) 和writeChars(String) 区别

本文介绍 Java DataOutputStream 中 write(int)和writeInt(int)的区别,writeBytes(String) 和writeChars(String) 的区别,并介绍 write(string.getBytes()) 与字符编码的基本知识。write(int), writeInt(int) 的区别在java DataOutputStream 中,定义

2016-06-03 15:09:14 15114

原创 使用java线程池的一个例子

使用java线程池的一个例子下面代码,开辟了一个数量为3的线程池,并向线程池里提交了10个任务。在主程序中获取各个任务的结果,并打印。import java.util.ArrayList;import java.util.List;import java.util.concurrent.Callable;import java.util.concurrent.Execut

2016-06-02 16:45:54 762

原创 Java编写一个死锁的程序

死锁是在多线程编程中常常遇到的问题,现在用java编写一个简单的死锁程序。程序在main()方法中启动2个线程,“线程-A”和“线程-B”。 线程-A 先拿到 lockA,再寻求拿到 lockB;线程-B 先拿到locB,再需求拿到lockA,如下图,于是变成循环等待,造成死锁。用java代码如下:public class DeadLockDemo { public sta

2016-06-02 16:22:57 7232

原创 什么是第一,第二,第三范式

我们在数据库表设计时,经常说,某某表要遵循第三范式。下面通过实例介绍第一,第二,第三范式第一范式所谓第一范式,就是数据表的列不可再分。看下面数据表,对于选课列明显是可以再分的,所以它是违反第一范式的。学号姓名选课10001张三数学,语文,英语10002

2016-06-02 13:45:49 36822 4

原创 数据库事务隔离级别实例探讨

我们知道,数据一般有如下四种隔离级别 0.  read uncommitted (读未提交)1.  read committed (读已提交)2.  repeatabale read (可重复读)3.  serializable read (串行化读)下面通过实例介绍这四种隔离级别。首先,准备工作, 我使用的数据库是Sysbase, 我们在数据库里建一个测试表,并插

2016-06-02 09:47:59 1659

原创 Java中自带的Logger使用

log1 = log2在Java中,自带了一个 java.util.logging.Logger, 由于有log4j的存在,这个再带的logger貌似使用比较少。下面就简单接收一下,这个logger的使用方法。首先看代码, 定义一个 LogUtil 用来返回一个自定义的logclass LogUtil { public static Logger getLogger()

2016-05-31 17:02:39 20106 1

原创 Java中动态生成代理的方法

本文介绍Java 动态生成代理的方法首先,说一下代理模式, 如下图,假设实际要使用的对象是Target实例,而Proxy是Target的代理, Proxy和Target必须要有相同的接口 TargetInterface, Client只依赖 TargetInterface,而不依赖具体的类。Client 对Proxy的方法调用,都被Proxy委托给Target。 在

2016-05-31 15:53:45 2416

原创 利用自定义的 ClassLoader 加密 Java Class 文件

本文演示利用自定义的 ClassLoader 加密 Java Class 文件首先,我们定义一个需要被加密的Java Class: classload.MyClassBase。 为了让客户端使用,需要定义一个 MyClassInterface, 这样客户端就不会直接引用 MyClassBase了,发布到客户端的class文件中是不存在 MyClassBase这个类的。MyC

2016-05-31 11:58:34 12126

Scala函数式编程

函数式编程(FP)是一种软件开发风格,它注重不依赖于编程状态的函数。函数式代码易于测试和复用,容易实现并发,且不容易受到bug的攻击。Scala是一种能很好支持函数式编程的新兴JVM语言。《Scala函数式编程》是针对希望学习FP并将它应用于日常编码中的程序员而写的,内容包括:函数式编程的概念;函数式编程相关的各种“为什么”和“怎么做”;如何编写多核程序;练习和检测。

2017-05-26

Kotlin in Action.pdf

Kotlin_in_Action_v12_MEAP.pdf

2017-05-23

SCALA 学习手册 2016.02

SCALA 学习手册 2016.02

2016-08-17

Core.Java.for.the.Impatient.2015(JavaSE8).pdf

Core.Java.for.the.Impatient.2015(JavaSE8).pdf

2015-03-09

Java 8 Pocket Guide.pdf

Designed to be your companion, this Pocket Guide provides a quick reference to the standard features of the Java programming language and its platform. This Pocket Guide provides you with the information you will need while developing or debugging your Java programs, including helpful programming examples, tables, figures, and lists. It also contains supplemental information about things such as the Java Scripting API, third-party tools, and the basics of the Unified Modeling Language (UML). The material in this book also provides support in preparing for the Oracle Certified Associate Java SE 7 Programmer I Exam. If you are considering pursuing this Java certification, you may also wish to consider acquiring OCA Java SE 7 Programmer I Study Guide (Exam 1Z0-803) by Edward Finegan and Robert Liguori (McGraw-Hill Osborne Media, 2012). Java coverage in this book is representative through Java SE 8. However, the primary differences between this Java 8 Pocket Guide and the prior Java 7 Pocket Guide is the addition of the Date and Time API and the Lambda Expressions chapters.

2015-02-02

Effective JavaScript.2014.pdf

Learning a programming language requires getting acquainted with its syntax, the set of forms and structures that make up legal programs, and semantics, the meaning or behavior of those forms. But beyond that, mastering a language requires understanding its pragmatics, the ways in which the language’s features are used to build effective programs. This latter category can be especially subtle, particularly in a language as flexible and expressive as JavaScript. This book is concerned with the pragmatics of JavaScript. It is not an introductory book; I assume you have some familiarity with Java Script in particular and programming in general. There are many excellent introductory books on JavaScript, such as Douglas Crockford’s Java- Script: The Good Parts and Marijn Haverbeke’s Eloquent JavaScript. My goal with this book is to help you deepen your understanding of how to use JavaScript effectively to build more predictable, reliable, and maintainable JavaScript applications and libraries.

2015-02-02

SCJP for Java 6

SCJP for Java 6.rar Chapter 1: Declarations and Access Control Chapter 2: Object Orientation Chapter 3: Assignments Chapter 4: Operators Chapter 5: Flow Control, Exceptions, and Assertions Chapter 6: Strings, I/O, Formatting, and Parsing Chapter 7: Generics and Collections Chapter 8: Inner Classes Chapter 9: Threads Chapter 10: Development Chapter 11: Introduction to the SCJD Chapter 12: Coding Standards Chapter 13: Clarity and Maintainability Chapter 14: Designing the Graphical User Interface Chapter 15: Networking Issues Chapter 16: Database Issues Chapter 17: Exam Documentation Chapter 18: Final Submission and Essay Glossary

2012-09-21

.JavaScript.and.jQuery.The.Missing.Manual.2nd.Edition.Oct.2011.

.JavaScript.and.jQuery.The.Missing.Manual.2nd.Edition.Oct.2011.

2012-09-21

Beginning.Java.EE.6.with.GlassFish3.2nd.2010.pdf

Beginning.Java.EE.6.with.GlassFish.3.2nd.2010.pdf

2010-09-03

Manning.GWT.in.Practice.Apr.2008.pdf

Manning.GWT.in.Practice.Apr.2008.pdf

2010-04-27

jQuery Cookbook Dec.2009.pdf

jQuery Cookbook Dec.2009.pdf

2010-04-13

Professional.JavaScript.for.Web.Developers.2nd.Edition.Jan.2009.pdf

Professional.JavaScript.for.Web.Developers.2nd.Edition.Jan.2009.pdf

2010-04-13

linux与unix shell编程指南.rar

linux unix shell 编程指南

2010-03-03

Oracle PL SQL by Example 4Ed.2008.pdf

Oracle PL SQL by Example 4Ed.2008.pdf

2009-12-29

Oracle.SQL.Recipes.A.Problem.Solution.Approach.Nov.2009.pdf

This book is for everyone working with Oracle SQL, be they DBAs, developers, report writers, or even end users. No matter what level of expertise you currently possess for writing and using SQL, there are recipes within Oracle SQL Recipes that will appeal to you. This book is not designed to teach you SQL or to act as a facsimile of the Oracle SQL reference. Instead, what you’ll find are elegant and sometimes tricky solutions to real problems that you’ll never see presented in a language manual

2009-12-29

RESTful Java Web Services (2009).pdf

RESTful Java Web Services (2009).pdf This book is for developers who want to code RESTful web services using the Java technology stack together with any of the frameworks Jersey's JAX-RS, Restlet's Lightweight REST, JBoss's JAX-RS RESTEasy, and Struts 2 with the REST plugin. You don't need to know REST, as we cover the theory behind it all; however, you should be familiar with the Java language and have some understanding of Java web applications. For each framework, we develop the same web service outlined in Chapter 4, RESTful Web Services Design. This is a practical guide and a greater part of the book is about coding RESTful web services, and not just about the theory of REST.

2009-12-21

Restful Java with Jax-RS.pdf

Restful Java with Jax-RS.pdf

2009-12-20

Programming.Groovy.2008.pdf

Programming.Groovy.2008.pdf

2009-12-20

Groovy.Recipes.2008.pdf

Groovy.Recipes.2008.pdf

2009-12-20

Unix Shell Scripting.rar

3 following books: (1)Classic.Shell.Scripting.pdf (2)Mastering Unix Shell Scripting.pdf (3)Unix Shell Programming. 3rd Ed.pdf

2009-12-14

Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow 2ed 2019.pdf

Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow 2ed 2019.pdf Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow SECOND EDITION Concepts, Tools, and Techniques to Build Intelligent Systems

2019-10-07

Manning.Amazon.Web.Services.in.Action.2nd.Edition.2018.9.pdf

Manning.Amazon.Web.Services.in.Action.2nd.Edition.2018.9.pdf

2018-10-12

Manning.Machine.Learning.Systems.2018.5.pdf

Manning.Machine.Learning.Systems.2018.5.pdf

2018-09-03

The Quick Python Book 3rd 2018

The Quick Python Book 3rd 2018 The Quick Python Book 3rd 2018 The Quick Python Book 3rd 2018

2018-07-27

MySQL and JSON: A Practical Programming GuideJun 8, 2018

ractical instruction on using JavaScript Object Notation (JSON) with MySQL This hands-on guide teaches, step by step, how to use JavaScript Object Notation (JSON) with MySQL. Written by a MySQL Community Manager for Oracle, MySQL and JSON: A Practical Programming Guide shows how to quickly get started using JSON with MySQL and clearly explains the latest tools and functions. All content is based on the

2018-06-15

Cloud-Native Applications in Java.pdf

Cloud-Native Applications in Java: Build microservice-based cloud-native applications that dynamical Cloud-Native Applications in Java: Build microservice-based cloud-native applications that dynamical

2018-04-27

Packt.Mastering.Blockchain.2nd.Edition.2018.3.pdf

( Packt.Mastering.Blockchain.2nd.Edition.2018.3.pdf ) ( Packt.Mastering.Blockchain.2nd.Edition.2018.3.pdf )

2018-04-18

Deep.Learning.with.TensorFlow.2nd.Edition.2018.3.pdf

( Packt.Deep.Learning.with.TensorFlow.2nd.Edition.2018.3.pdf ) ( Packt.Deep.Learning.with.TensorFlow.2nd.Edition.2018.3.pdf )

2018-04-18

智能简史 智能简史 讲话 PPT

( 智能简史 讲话.pdf ) ( 智能简史 讲话.pdf ) ( 智能简史 讲话.pdf ) ( 智能简史 讲话.pdf )

2018-04-18

基于TensorFlow的高效交互式深度学习平台及应用 ppt

2018人工智能大会ppt,2018人工智能大会ppt 基于TensorFlow的高效交互式深度学习平台及应用 ppt

2018-04-18

TensorFlow对科学的影响

2018人工智能大会ppt,2018人工智能大会ppt TensorFlow对科学的影响

2018-04-18

Spark: The Definitive Guide: Big Data Processing Made Simple 1st Edition

Spark: The Definitive Guide: Big Data Processing Made Simple 1st Edition Spark: The Definitive Guide: Big Data Processing Made Simple 1st Edition Spark: The Definitive Guide: Big Data Processing Made Simple 1st Edition

2018-03-10

Java.Interview.Guide.How.to.Build.Confidence.With.pdf

Java.Interview.Guide.How.to.Build.Confidence.With.a.Solid.Understanding.of.Core.Java.Principles.B015HF9SJQ.pdf Java.Interview.Guide.How.to.Build.Confidence.With.a.Solid.Understanding.of.Core.Java.Principles.B015HF9SJQ.pdf Java.Interview.Guide.How.to.Build.Confidence.With.a.Solid.Understanding.of.Core.Java.Principles.B015HF9SJQ.pdf

2018-01-03

数据科学入门(Data Science from Scratch 中文版).pdf

数据科学入门_P286_2016.03.pdf [OReilly].Data.Science.from.Scratch.First.Principles.with.Python.2015 中文版

2017-12-07

Manning.Reactive.Web.Applications.2016.6.pdf

Manning.Reactive.Web.Applications.2016.6.pdf Manning.Reactive.Web.Applications.2016.6.pdf

2017-11-09

Core.Java.SE.9.for.the.Impatient.2nd.Edition.2017.9.pdf

Core.Java.SE.9.for.the.Impatient.2nd.Edition.2017.9.pdf Core.Java.SE.9.for.the.Impatient.2nd.Edition.2017.9.pdf

2017-11-09

数据结构与算法经典问题解析 Java语言描述.pdf

内容简介 本书以Java为描述语言,介绍了数据结构与算法的基本知识。书中结合企业界的工程实践提炼教学内容,特别对数据结构中易混淆的问题进行了梳理,对每一个问题提出不同的解决方案。本书是一本优秀的数据结构方面的教材。 前言/序言 我知道许多读者往往不读前言,但是强烈建议你至少浏览一下本书前言,因为本书前言与众不同。 本书的主要目的不是提供关于数据结构和算法的定理及证明。本书采用的模式是利用不同的复杂度改善问题的解(对于每个问题,你将发现多个具有不同复杂度及降低复杂度的解法)。基本上,这一思路就是列举某个问题的所有可能解。通过这种方式,即使你遇到一个新问题,它也能够向你指明如何思考该问题所有可能的解。本书对于正在准备面试、参加选拔性考试以及校园面试的读者很有帮助。 作为一个求职者,如果你能完整地阅读本书并且很好地领会书中的内容,相信你会从容地面对面试官,这正是本书的目的所在。若作为一个教师来阅读本书,你将能够用简单的方法来提升授课质量,学生也会为选择攻读计算机科学/信息技术学位而感到欣慰。 作为准备参加计算机科学/信息技术专业选拔考试的学生,本书完整而详细地涵盖了所有必需的主题,在撰写本书时,就着眼于帮助正在准备这些考试的学生。 本书对攻读工程学位的学生和研究生都非常有用。在所有的章节中,你会发现本书更强调问题及其分析,而不是理论的阐述。每一章将首先阐述必要的理论基础,然后再给出问题集。书中大约有700个算法问题及相应的解。 京东购买链接:https://item.jd.com/11972824.html

2017-09-06

Scala and Spark for Big Data Analytics.pdf

Chapter 1, Introduction to Scala, will teach big data analytics using the Scalabased APIs of Spark. Spark itself is written with Scala and naturally, as a starting point, we will discuss a brief introduction to Scala, such as the basic aspects of its history, purposes, and how to install Scala on Windows, Linux, and Mac OS. After that, the Scala web framework will be discussed in brief. Then, we will provide a comparative analysis of Java and Scala. Finally, we will dive into Scala programming to get started with Scala. Chapter 2, Object-Oriented Scala, says that the object-oriented programming (OOP) paradigm provides a whole new layer of abstraction. In short, this chapter discusses some of the greatest strengths of OOP languages: discoverability, modularity, and extensibility. In particular, we will see how to deal with variables in Scala; methods, classes, and objects in Scala; packages and package objects; traits and trait linearization; and Java interoperability.

2017-09-06

Scala.for.the.Impatient.2nd.2017.pdf

Scala.for.the.Impatient.2nd.2017.pdf

2017-08-09

Spring Microservices pdf

Spring Microservices Java

2017-08-09

空空如也

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

TA关注的人

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