自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(188)
  • 资源 (14)
  • 收藏
  • 关注

原创 WebSocket 的原理和Client的实现

简介: 过去,创建需要在客户端和服务之间双向通信(例如,即时消息和游戏应用)的web应用,需要一个滥用的HTTP来轮询服务器进行更新但以不同的HTTP调用发生上行通知[RFC6202]。这将导致各种各样的问题:1、服务器被迫为每个客户端使用一些不同的底层TCP连接: 一个用于发送信息到客户端和一个新的用于每个传入消息。2、线路层协议有较高的开销,因为每个客户端-服务器消息都有一

2014-05-29 17:59:03 6209

原创 Android 通过 annotation ViewInject

前言: 通常对控件的获取对象是通过sourceView.findViewById(R)

2014-05-26 21:00:39 1901

转载 Android翻译之---- Drag and Drop

用Android的拖放框架,能够允许用户使用图形化的拖放手势,把数据从当前布局中的一个View对象中移到另一个View对象中。这个框架包括:拖拽事件类、拖拽监听器、以及辅助的方法和类。尽管这个框架主要是为数据移动设计的,但是你能够把它用于其他的UI操作。如,你能够创建一个调色应用程序,用户把一个颜色的图标拖到另一个颜色图标之上,完成两个颜色的调配操作。概要当用户使用一些被认

2014-04-15 16:00:10 1267

转载 Android基础进阶之----手势跟踪

参考:http://blog.csdn.net/p106786860/article/details/17347501

2014-04-14 11:20:45 1475

原创 Android部分开源项目源码分析之---Volley源码分析(一)

简介: Volley 是Google 在2013 年的IO大会上面推出的HTTP的操作的类库。 其主要提供了类似于浏览器响应HTTP 304中缓存的设计。 我们可以参考 理解HTTP/304响应 ,发出一个url的http请求,如果缓存的有这个请求,带上 个If-Modified-Since的请求头,其值为服务器上次返回的Last-Modified响应头中的日期值。 通过响应码200 和3

2014-04-03 18:04:23 1483

原创 Java闲言碎语之----构造器参数传递

简介:我们知道java内存中对象的分配 一般的粗略的分配是, 堆、栈上。在Java的创建每一个对象的时候,所以的实例变量都要在堆上分配。同时,也有一个栈帧的(Stack Frane)的创建,用于存储局部变量、操作栈、方法等信息。局部变量存放一些在编译期可知的各种基本的数据的类型(如:boolean byte char string long double) 对象引用等。在构造器中传递引用和

2014-04-03 11:15:59 1044

原创 Android源码分析之---View.MeasureSpec 解析

1、简介    一个MeasureSpec封装了父布局传递给子布局的布局要求,每个MeasureSpec代表了一组宽度和高度的要求。一个MeasureSpec由大小和模式组成。它有三种模式:UNSPECIFIED(未指定),父元素部队自元素施加任何束缚,子元素可以得到任意想要的大小;EXACTLY(完全),父元素决定自元素的确切大小,子元素将被限定在给定的边界里而忽略它本身大小;A

2014-04-01 16:53:17 1682

原创 Android部分开源项目源码分析之---ViewBadge(View 上面动态的自定义的添加view)

前言:我们有时候,需要在已经设计好的界面上的某一个View上,在事后添加一些view. 如一个消息到达的时候,在切换到消息的那个空间上面,显示一个消息数量的图标。在开源的项目 https://github.com/jgilfelt/android-viewbadger 中,实现了这样的效果。见下图                          在上图的Button 中,上面

2014-03-28 10:31:37 1517

原创 Android部分开源项目源码分析之--ListView 图片顶部模糊的高斯处理

前言:我们可以看到APP"在路上"上面的 高斯的模糊的处理的效果,在下拉的时候,图像就会变的清晰, 看到了这个效果,我也开始对其进行模仿。      我做的效果设计的思路:我开始在想直接用高斯模糊处理图片,在图片不断的下拉的过程中也对图片的进行高斯处理达到实时对图片进行高斯模糊处理,达到 下拉到最下面的 图片变的clear,在拉动的过程中,图片的模糊度也随之变化

2014-03-21 17:27:26 1864 1

原创 Android部分开源项目源码分析之--图片滑动的效果

前言:  我们时常可以看到一张图片在一个固定大小的布局中,慢慢的滑动图片,这样的一个效果看起来有一定的灵动性,感觉很好看的,特别是用一张天空云,作为背景看去来,还不错的。很有吸引力的。 我在https://github.com/jpardogo/ListBuddies 中看到了这样的效果,现在把这个code摘录出来。详见: https://github.com/dblackde/Bac

2014-03-17 17:53:45 1496

原创 Android部分开源项目源码分析--log信息的打印

前言:平常在android应用的开发的过程中间,我们都需要对应用的部分信息,打印出来,好在LogCat中查看。        然而,普通的日志的打印,有时候是很难定位到具体的代码中的。      在 https://github.com/MustafaFerhan/DebugLog 提供了一种比较好的日志的显示的方式。我们可以定位到具体代码的每一行和每个方法;C

2014-03-17 10:52:00 1219

原创 Android 属性动画的原理分析

前言: 我们知道Android有PropertyAnimation和Tweened 动画,在前面,我简单的说Android Tweened的原理(Tweened animations 动画原理简单分析)。       在此,我在描述下,在调用了view.startAnimation(animation)后,View 就开始不停的刷新和检查是否有动画属性的存在,如果有,就调用 继承A

2014-03-13 17:59:04 1243

原创 Android 源码分析之Looper 、Handler、 MessageQueue 关系源码分析

引言: Looper为一个Thread提供一个消息的循环。线程在默认的情况下是没有message loop,如果想要创建这个message loop ,需要调用  Looper.prepare();   Looper.loop(); 为了相互作用这个message loop常常使用Handler。官方提供的使用的例子:class LooperThread extends Threa

2014-03-12 17:22:41 1232

转载 【Java并发编程实践】— ThreadLocal分析

前言首先,ThreadLocal 不是用来解决共享对象的多线程访问问题的,一般情况下,通过ThreadLocal.set() 到线程中的对象是该线程自己使用的对象,其他线程是不需要访问的,也访问不到的。各个线程中访问的是不同的对象。(注意这里说的只是“一般情况”,如果通过ThreadLocal.set() 到线程中的对象是多线程共享的同一个对象,各个线程中访问的将是同一个共享对象)。

2014-03-12 14:37:06 797

原创 Tweened animations 动画原理简单分析

1、view动画的包结构Tween 动画是建立在View的级别上的,在 View 类中有一个接口 startAnimation 来使动画开始,startAnimation 函数会将一个 Animation类别的参数传给 View,这个 Animation 是用来指定我们使用的是哪种动画,现有的动画有平移,缩放,旋转以及 alpha 变换等。如果需要更复杂的效果,可以将这些动画组合起来。

2014-02-26 11:28:35 1785 1

原创 Android View中 layout 的使用

1、layout简介  给View 以及其它的所有的子节点都分配了一个尺寸;这也是布局的第二个步骤,(第一个步骤是measuing).在这一个步骤中,每一个每一个父节点都会回调layout.This is typically done using the child measurements that were stored in the measure pass()继承的

2014-02-25 15:38:32 1451

转载 Java多线程 之BlockingQueue深入分析

一、概述:BlockingQueue作为线程容器,可以为线程同步提供有力的保障。二、BlockingQueue定义的常用方法1.BlockingQueue定义的常用方法如下: 抛出异常特殊值阻塞超时插入add(e)offer(e)put(e)offer(e, time, unit)移

2014-02-21 14:45:04 902

转载 Android adb 模拟滑动 按键 点击事件

模拟事件全部是通过input命令来实现的,首先看一下input命令的使用: usage: input ...       input text        input keyevent        input tap        input swipe 1. keyevent指的是android对应的keycode,比如home键的

2014-02-21 14:14:34 1406

原创 Android Animation之初涉动画

一、动画简介:一个animation资源能够定义两种动画。1、  Property Animation (在3.0以后支持) 2、  View Animation有两种类型的动画被viewanimation framework支持。(1)      Tween Animation(补间动画)能够执行平移、缩放、旋转、渐变的动画效果(2)      Frameanim

2014-01-04 17:22:42 963

转载 Android开发性能优化简介

这篇文章来自北京大学Android研究实验室,不得不说写的真是好,没给PKU丢脸~==============================================================作者:贺小令       随着技术的发展,智能手机硬件配置越来越高,可是它和现在的PC相比,其运算能力,续航能力,存储空间等都还是受到很大的限

2013-12-27 09:29:49 1228

转载 Java代码注释XXX、TODO、FIXME的意义

特殊注释:1、 TODO表示需要实现,但目前还未实现的功能2 、XXX勉强可以工作,但是性能差等原因3 、FIXME代码是错误的,不能工作,需要修复TODO: + 说明:如果代码中有该标识,说明在标识处有功能代码待编写,待实现的功能在说明中会简略说明。FIXME: + 说明:如果代码中有该标识,说明标识处代码需要修

2013-12-24 14:04:55 1207

转载 Java异常处理的陋习展播

你觉得自己是一个Java专家吗?是否肯定自己已经全面掌握了Java的异常处理机制?在下面这段代码中,你能够迅速找出异常处理的六个问题吗?OutputStreamWriter out = ...java.sql.Connection conn = ...try{ // ⑸  Statement stat = conn.createStatement();  ResultSet rs

2013-11-25 13:32:55 911

原创 DevBytes: View Animations

简介:本文讲解了,怎样使用pre-3.0 API 创建多种多样的动画的效果,关于Property Animations 请参考上一讲的内容 (DevBytes: Property Animations)。https://www.youtube.com/watch?v=_UWXqFBF86Upublic class ViewAnimations extends

2013-10-06 17:36:34 995

原创 DevBytes: Property Animations

简介:怎样使用 property animations,特别是ObjectAnimator,给出了多种多样的动画。比起ViewAnimations ,ObjectAnimator表现了更多易使用的方法。ps: property animations只是支持在android 3.0之上。https://www.youtube.com/watch?v=3UbJhmkeS

2013-10-06 13:47:36 1778

原创 DevBytes: CrossFading Animations

简介:这个例子显示了怎样使用TransitionDrawable ,two drawables互换显示过程中的淡出,淡入的效果。两张图片的过度的效果。public class CrossFading extends Activity { int mCurrentDrawable = 0; @Override public void onCreat

2013-10-06 13:12:41 937

原创 DevBytes: KeyFrame Animations

简介:How to use TransitionDrawable to perform a simple cross-fade effect between two drawables.

2013-10-05 23:38:11 1046

原创 DevBytes: Bounce Animations

简介:简单的使用 ValueAnimator, ObjectAnimator, and interpolators控制一个形状在屏幕上面移动。视频 观看地址:https://www.youtube.com/watch?v=vCTcmPIKgpM代码:public class Bouncer extends Activity { @Override public

2013-10-05 18:10:40 1178

转载 Android API Guide --- PropertyAnimation(属性动画)

Android动画概要---Animation OverviewAndroid框架提供 了两种动画系统:属性动画(在Android3.0中被引入)和视图动画。这两种动画系统都是可行的选择,但是通常属性动画是首选的方法,因为它更加灵 活,并提供了更多的功能。除了这两种动画系统之外,还能够利用绘图动画,它允许加载绘图资源并一帧一帧的来显示它们。属性动画在Android3.0中被引入(API

2013-10-05 18:08:23 2995

原创 DevBytes: RequestDuringLayout

简介:Gooogle Android 团队在  https://www.youtube.com/watch?v=HbAeTGoKG6k 的课程《DevBytes: RequestDuringLayout》,描述了,我们不应该在代码布局的时候,我们不应该在上面写一些code,特别是布局的代码,这将要影响布局。Demo下载地址:http://developer.android.com/shar

2013-09-29 10:39:59 1046

原创 DevBytes: Bitmap Scaling

图片的Scaling:下面这个example展示了怎样使用BitmapOptions,影响图片的加载的效果。Sub-sampling 能够加快图片加载的时间和 减少图片所占用的内存。它不能得到图片的大小,而只是在2的幂下的图片的大小  1/2 1/4 1/8。源码:* * This example shows how the use of BitmapOptions affe

2013-09-28 23:39:44 916

原创 Android 自定义控件

简介:在平常应用的开发的过程中,系统提供的一些控件是不能够满足我们的需求的。在这种情况下,我们可以自定义自己的控件,达到我们需要的效果。1、继承其它控件类(EditText、Button)2、 组合方式。当前控件类从容器类继承,并将若干个控件添加到当前的容器中。3、 绘制控件,也就是控件类从View继承,并在onDraw方法中从零绘制控件。例如,TextView。 

2013-09-28 19:35:47 1692

原创 android 图片的倒影

简介:图片倒影的基本的思路: 1、 从源图片上面一部分截取下来作为倒影的素材 2、将源图片和倒影拼接成为一张完整的图片3、在图片的倒影的部分绘制渐变的倒影的效果源码: public Bitmap createReflectionImg(Bitmap bitmap){ //倒影上下的分割线的长度 final int reflection

2013-09-28 09:46:18 1384 1

原创 Java 信号量

简介:信号量(Semaphore),有时被称为信号灯,是在多线程环境下使用的一种设施,是可以用来保证两个或多个关键代码段不被并发调用。在进入一个关键代码段之前,线程必须获取一个信号量;一旦该关键代码段完成了,那么该线程必须释放信号量。其它想进入该关键代码段的线程必须等待直到第一个线程释放信号量。为了完成这个过程,需要创建一个信号量VI,然后将Acquire Semaphore VI以及Rele

2013-09-15 18:24:19 932

原创 Java 障碍器

简介:CyclicBarrier就象它名字的意思一样,可看成是个障碍, 所有的线程必须到齐后才能一起通过这个障碍。当所有的任务都达到障碍点的时候,最后的任务才会被执行。 DOC:一个同步辅助类,它允许一组线程互相等待,直到到达某个公共屏障点 (common barrier point)。在涉及一组固定大小的线程的程序中,这些线程必须不时地互相等待,此时 CyclicBarrier

2013-09-15 18:00:54 905

原创 Java 锁

1、Lock 接口常用方法方法摘要 voidlock()     获取锁(阻塞的方法,如果,不能获取锁一直进入阻塞的状态,直到获得锁。) booleantryLock()     仅在调用时锁为空闲状态才获取该锁。(非阻塞的方法,如果,不能获取锁,就返回false。) boolean

2013-09-14 23:25:25 821

原创 生产者 消费者 (wait notify)

1、简介:生产者-消费者(producer-consumer)问题是一个著名的线程同步问题。它描述的是:有一群生产者线程在生产产品,并将这些产品提供给消费者线程去消费。为使生产者与消费者之间能够并发执行,在两者之间设置了一个具有n个缓冲区的缓冲池,生产者将它所生产的产品放入一个缓冲区中;消费者可以从一个缓冲区中取走产品产生消费。尽管所有的生产者线程和消费者线程都是以异步方式运行的,但他们之间必

2013-09-14 16:56:55 1105

原创 关于 Java Collections API 您不知道的 5 件事

关于Java Collections API您不知道的 5件事,第 1部分Java Collections API远不止是数组的替代品,虽然一开始这样用也不错。Ted Neward提供了关于用 Collections做更多事情的 5个技巧,包括关于定制和扩展 Java Collections API的基础。 关于Java Collec

2013-08-30 17:52:47 1039

原创 Android 上面的Linux C程序

我们知道Android是基于Linux的,上面是可以运行C或C++编写的程序,就像在Linux上面。在官方提供的NDK里面的samples目录下面,有个test-libstdc++项目,我们直接在命令ndk-build(如图)生成了一个文件test-libstl文件,这个文件直接移动到data/app 目录下,打开第三方的终端,执行这个文件,我们便可以运行这个文件。#i

2013-08-10 10:06:26 1121

原创 Windows下,Eclipse的Android NDK(r9) 配置和初步使用

简介:NDK是一个工具集,可让您实现您的应用程序使用本机代码的语言,如C和C + +。对于某些类型的应用程序,这可以是有益的,所以你可以重用现有的代码库,这些语言编写的,但大多数应用程序不需要的Andr​​oid NDK。下载NDK之前,你应该明白,NDK将不会惠及大多数应用程序。作为一个开发者,你需要平衡它的好处,针对其缺点。值得注意的是,在Android上使用本机代码一般不会导致在一个

2013-07-28 17:33:13 5647 2

原创 Android 学习之--HttpClient详细使用

简介:我们知道在Android上面,支持Socket ,HttpURLConnection(java自带的),HttpClient(apache实现的),这三种基本的数据通信的方式,HttpClient提供了较多的HTTP操作的实现,Android官方推荐使用。目前,我们常用的HTTP的Method有两个POST个GET,在各种资料上面都有很很多简单的介绍。本文对其简单的介绍一个小小的补充

2013-07-10 17:45:16 1247

core_java_career_essentials.pdf

"Core Java Essentials" are something you must know, and know it well to succeed as a Java professional. Even 40% to 60% of the so called experienced professionals fail to make an impression due to their lack of understanding in one or more of the areas covered in this book. Lack of good understanding in the core essentials can be a speed breaker to your career advancement. If you have a java interview coming up in a few days or you want to impress your peers and superiors with your technical strengths during code review sessions, team meetings, and stand-ups, and concerned about how to make a good impression? You don't need to worry if you are familiar with the fundamentals. This is a Questions & Answers book with 250+ questions and answers relating to core Java with lots of code snippets (100+), examples, and diagrams. Most Java interviews and technical challenges you face at work are structured around the fundamentals and how well you communicate those fundamentals. So regularly brushing up on these fundamentals really pays off. Your analytical, problem solving, and coding skills will also be under scrutiny along with your ability to get the job done with the right tools. If your fundamentals are clear and know what tools to use, you can tackle any questions, and find solutions to any problems and challenges you face. Even if you don't have the exact answer for a problem, you will know how to go about solving them with a little research if you have a solid grounding in the fundamentals covered in this book. A little preparation can make a huge difference to your career success. Preparation can help you communicate your thoughts more clearly with examples and illustrations. Preparation can make a good and lasting impression on those who talk with you during your interviews and team meetings. This impression will be partly influenced by how prepared you are and how knowledgeable you are about your industry and the challenges it faces. It will also be influenced by your appearance, attitude, enthusiasm, and confidence. Good preparation breeds confidence and it shows in the interviews and team meetings. So prepare well in advance if you just begun to see yourself in your dream company or would like to go places in your chosen field.

2017-12-06

OpenCV By Example

About This Book, Get to grips with the basics of Computer Vision and image processingThis is a step-by-step guide to developing several real-world Computer Vision projects using OpenCV 3This book takes a special focus on working with Tesseract OCR, a free, open-source library to recognize text in images, Who This Book Is For, If you are a software developer with a basic understanding of Computer Vision and image processing and want to develop interesting Computer Vision applications with Open CV, this is the book for you. Knowledge of C++ is required., What You Will Learn, Install OpenCV 3 on your operating systemCreate the required CMake scripts to compile the C++ application and manage its dependenciesGet to grips with the Computer Vision workflows and understand the basic image matrix format and filtersUnderstand the segmentation and feature extraction techniquesRemove backgrounds from a static scene to identify moving objects for video surveillanceTrack different objects in a live video using various techniquesUse the new OpenCV functions for text detection and recognition with Tesseract, In Detail, Open CV is a cross-platform, free-for-use library that is primarily used for real-time Computer Vision and image processing. It is considered to be one of the best open source libraries that helps developers focus on constructing complete projects on image processing, motion detection, and image segmentation., Whether you are completely new to the concept of Computer Vision or have a basic understanding of it, this book will be your guide to understanding the basic OpenCV concepts and algorithms through amazing real-world examples and projects., Starting from the installation of OpenCV on your system and understanding the basics of image processing, we swiftly move on to creating optical flow video analysis or text recognition in complex scenes, and will take you through the commonly used Computer Vision techniques to build your own Open CV projects from scratch., By the end of this book, you will be familiar with the basics of Open CV such as matrix operations, filters, and histograms, as well as more advanced concepts such as segmentation, machine learning, complex video analysis, and text recognition.

2017-11-23

例子代码 android http://blog.csdn.net/qq282133/article/details/7616809

http://blog.csdn.net/qq282133/article/details/7616809

2012-05-30

libgdx-0.9.2.zip

libgdx-0.9.2.zip libgdx-0.9.2.zip libgdx-0.9.2.zip

2011-11-15

java 串口通信 包 comm.jar

java 串口通信 包 comm.jar win32com.dll javax.comm.properties

2011-10-21

贪吃蛇.jar

贪吃蛇.jar import java.io.IOException; import java.util.Hashtable; import java.util.Vector; import javax.microedition.lcdui.Font; import javax.microedition.lcdui.Graphics; public class DCSnake extends i { private h jdField_a_of_type_H; private h jdField_b_of_type_H; private h jdField_c_of_type_H; private boolean jdField_c_of_type_Boolean; private boolean d; private int jdField_a_of_type_Int; private int jdField_b_of_type_Int; private int jdField_c_of_type_Int; private boolean e; private f jdField_a_of_type_F; private f jdField_b_of_type_F; private f jdField_c_of_type_F; public final void a(int paramInt) { if (!this.jdField_c_of_type_Boolean) { paramInt = this; if (!this.d) { paramInt.jdField_a_of_type_Int = 6; paramInt.jdField_b_of_type_Int = 0; paramInt.d = true; return; } if (paramInt.jdField_b_of_type_Int < paramInt.jdField_a_of_type_Int) { Object localObject1; switch (paramInt.jdField_b_of_type_Int) { case 0: a.a(); break; case 1: this = paramInt; try { localObject1 = null; localObject1 = Font.getFont(32, 0, 8); Font localFont1 = Font.getFont(32, 1, 8); Font localFont2 = Font.getFont(32, 1, 0); this.jdField_a_of_type_F = new f((Font)localObject1, 0, -1); this.jdField_b_of_type_F = new f(localFont1, 16777215, 0); this.jdField_c_of_type_F = new f(localFont2, 16776960, 32768); t.a(this.jdField_c_of_type_F, this.jdField_a_of_type_F, this.jdField_b_of_type_F); } catch (IOException localIOException) { } case 2: localObject1 = a.a(new int[] { 1245188, 1245190, 1245189 }); v[] arrayOfv = a.a(new int[] { 1245191, 1245193, 1245192 }); t.a(new c(localObject1, true), new c(arrayOfv, true)); break;

2011-09-12

仿 qq 相册

OCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>jQuery lightBox plugin</title> <link rel="stylesheet" type="text/css" href="../style-projects-jquery.css" /> <!-- Arquivos utilizados pelo jQuery lightBox plugin --> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/jquery.lightbox-0.5.js"></script> <link rel="stylesheet" type="text/css" href="css/jquery.lightbox-0.5.css" media="screen" /> <!-- / fim dos arquivos utilizados pelo jQuery lightBox plugin --> <!-- Ativando o jQuery lightBox plugin --> <script type="text/javascript"> $(function() { $('#gallery a').lightBox(); }); </script> <style type="text/css">

2011-08-31

jdbc 2008

jdbc2008 jdbc2008的驱动

2011-07-30

java 浏览器 源码

java 浏览器 源码 public class EditorPaneTest { public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { JFrame frame = new EditorPaneFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } }); } }-------《java核心技术》

2011-07-30

java 记事本

java记事本 点击就可运行! 需安java的 jvm!

2011-07-30

高校选课系统 源码 strcts2 spring

高校选课系统 strcts2 spring <%@ page language="java" pageEncoding="GBK"%> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%> <html> <head> <title>高校选课系统首页</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"><style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } .STYLE1 {color: #FF0000} .STYLE3 {color: #FF0000; font-size: 9pt; } .STYLE7 {font-size: 9pt} --> </style></head>

2011-07-18

java 坦克大战源码

package cn.hnist.Joshua; //download by http://www.codefans.net import java.awt.*; public class HitPoint { public static final int HITPOINTSIZE=50; //血条的长度 int topNumber; //总血量 int number; //当前血量 Tank tk; public HitPoint(int topNum,Tank tk) { if(topNum>50||topNum<=0) { this.topNumber=50; } topNumber=topNum; number=topNum; this.tk=tk; } public void draw(Graphics g) { Color c=g.getColor(); g.setColor(Color.white); g.drawRect(tk.x-25,tk.y-35,HITPOINTSIZE,5); g.setColor(Color.red); g.fillRect(tk.x-24,tk.y-34,number*HITPOINTSIZE/topNumber-1,4); g.setColor(c); } public void cutsHitPoint(int cuts) //发生碰撞时的减血 { number-=cuts; if(isEmpty()) { tk.dead(); } //若血空了,Tank死掉 } public void cutsHitPoint(int cuts,Shot s) //被子弹击中时的减血 { number-=cuts; if(tk.isLive&&tk instanceof RobotTank) { ((RobotTank) tk).avoidThrust(s); } if(isEmpty()) { tk.dead(); } //若血空了,Tank死掉 } public void raisesHitPoint(int raises) //血量增加 { number+=raises; if(number>topNumber) { number=topNumber; } } public boolean isEmpty() { if(number<=0) { return true; } else { return false; } } }

2011-04-30

asp.net2.0入门经典C#编程篇2 英文.pdf

asp.net和c#入门精典1章 ASP.NET 3.5入门....................1 1.1 Microsoft Visual Web Developer.....................................2 1.1.1 获取Visual Web Developer......2 1.1.2 安装Visual Web Developer Express Edition...................................3 1.2 创建第一个ASP.NET 3.5 Web站点......................................4 1.3 ASP.NET 3.5简介.......................8 1.3.1 HTML....................................10 1.3.2 初识ASP.NET标记................13 1.4 IDE.............................................14 1.4.1 主开发区................................14 1.4.2 信息窗口................................20 1.5 定制IDE.....................................21 1.5.1 重新排列窗口........................21 1.5.2 修改Toolbox...........................22 1.5.3 定制文档窗口........................24 1.5.4 定制工具栏............................24 1.5.5 定制键盘快捷键....................25 1.5.6 重置修改................................25 1.6 示例应用程序............................26 1.7 关于Visual Web Developer 的实用提示................................28 1.8 小结............................................29 1.9 练习............................................29 第2章构建ASP.NET站点..................31 2.1 用VWD 2008创建 Web站点......................................31 2.1.1 不同项目类型........................32 2.1.2 选择正确的Web 站点模板..........................................33 2.1.3 创建与打开新Web站点.........34 2.2 操作Web站点中的文件.............37 2.2.1 ASP.NET 3.5 Web 站点的文件类型...............................37 2.2.2 添加现有文件........................40 2.2.3 组织站点................................41 2.2.4 特殊文件类型........................43 2.3 使用Web Forms..........................43 2.3.1 关于Web Form的不同视图...........................................43 2.3.2 在Code Behind和带内联代码的页面之间选择.......................45 2.3.3 向页面添加标记....................49 2.3.4 连接页面................................55 2.4 使用Web Forms的实用提示......57 2.5 小结............................................57 2.6 练习............................................

2011-03-13

空空如也

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

TA关注的人

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