上一页 1 ··· 9 10 11 12 13 14 下一页

2013年5月31日

JFreeChart : a free chart library for the Java(tm) platform

摘要: 001/* ===========================================================002 * JFreeChart : a free chart library for the Java(tm) platform003 * ===========================================================004 *005 * (C) Copyright 2000-2011, by Object Refinery Limited and Contributors.006 *007 * Project Info: 阅读全文

posted @ 2013-05-31 05:40 Step-BY-Step 阅读(789) 评论(0) 推荐(0) 编辑

JFreeChart

摘要: Overview Package Class Use Source Tree Index Deprecated AboutFrames | No FramesSource for org.jfree.chart.JFreeChart 1: /* =========================================================== 2: * JFreeChart : a free chart library for the Java(tm) platform 3: * =======================================... 阅读全文

posted @ 2013-05-31 05:39 Step-BY-Step 阅读(436) 评论(0) 推荐(0) 编辑

2013年5月29日

JRXML报表模板的元素

摘要: 下面列出了<jasperReporot>根元素的全部子元素。<property>此元素用来给报表模板添加任意的信息。<property name="someproperty" value="somevalue"/>加裁了报表的Java应用程序通过调用JasperReport.getProperty()方法可以载入这些属性。JRXML模板可以包含零个或多个<property>元素。<import>此元素用于导入个别的Java类或完整的包。<import value="java.ut 阅读全文

posted @ 2013-05-29 06:42 Step-BY-Step 阅读(1189) 评论(0) 推荐(0) 编辑

Data access object(DAO)

摘要: Incomputer software, adata access object(DAO) is anobjectthat provides an abstractinterfaceto some type ofdatabaseor other persistence mechanism. By mapping application calls to the persistence layer, DAOs provide some specific data operations without exposing details of the database. This isolation 阅读全文

posted @ 2013-05-29 00:53 Step-BY-Step 阅读(242) 评论(0) 推荐(0) 编辑

2013年5月28日

getResource()和getResourceAsStream以及路径问题

摘要: 转自http://blog.sina.com.cn/s/blog_4b5bc0110100g22w.html用JAVA获取文件,听似简单,但对于很多像我这样的新人来说,还是掌握颇浅,用起来感觉颇深,大常最经常用的,就是用JAVA的File类,如要取得c:/test.txt文件,就会这样用File file = new File("c:/test.txt");这样用有什么问题,相信大家都知道,就是路径硬编码,对于JAVA精神来说,应用应该一次成型,到处可用,并且从现实应用来讲,最终生成的应用也会部署到Windows外的操作系统中,对于linux来说,在应用中用了c:/这样的字 阅读全文

posted @ 2013-05-28 23:39 Step-BY-Step 阅读(123) 评论(0) 推荐(0) 编辑

2013年5月25日

jdbc与hibernate的优缺点比较(转载的精髓)

摘要: 转自http://www.cnblogs.com/frankliiu-java/archive/2010/12/24/1915994.html#2657428一、 Hibernate是JDBC的轻量级的对象封装,它是一个独立的对象持久层框架,和App Server,和EJB没有什么必然的联系。Hibernate可以用在任何JDBC可以使用的场合,例如Java应用程序的数据库访问代码,DAO接口 的实现类,甚至可以是BMP里面的访问数据库的代码。从这个意义上来说,Hibernate和EB不是一个范畴的东西,也不存在非此即彼的关系。二、Hibernate是一个和JDBC密切关联的框架,所以Hibe 阅读全文

posted @ 2013-05-25 07:36 Step-BY-Step 阅读(196) 评论(0) 推荐(0) 编辑

Java中的Enum的使用与分析

摘要: 转自http://www.cnblogs.com/frankliiu-java/archive/2010/12/07/1898721.html示例:public enum EnumTest { FRANK("The given name of me"), LIU("The family name of me"); private String context; private String getContext(){ return this.context; } private EnumTest(String context){ this.context 阅读全文

posted @ 2013-05-25 07:22 Step-BY-Step 阅读(170) 评论(0) 推荐(0) 编辑

java.util.Calendar的用法

摘要: 转自 http://blog.csdn.net/wangtao041/article/details/2757824Calendar类是一个抽象类,它为特定瞬间与一组诸如YEAR、MONTH、DAY_OF_MONTH、HOUR等日历字段之间的转换提供了一些方法,并为操作日历字段(例如获得下星期的日期)提供了一些方法。瞬间可用毫秒值来表示,它是距历元(即格林威治标准时间 1970 年 1 月 1 日的 00:00:00.000,格里高利历)的偏移量。该类还为实现包范围外的具体日历系统提供了其他字段和方法。这些字段和方法被定义为protected。与其他语言环境敏感类一样,Calendar提供了一 阅读全文

posted @ 2013-05-25 06:51 Step-BY-Step 阅读(451) 评论(0) 推荐(0) 编辑

对象的串行化(Serialization)

摘要: 对象的串行化(Serialization)一、串行化的概念和目的1.什么是串行化对象的寿命通常随着生成该对象的程序的终止而终止。有时候,可能需要将对象的状态保存下来,在需要时再将对象恢复。我们把对象的这种能记录自己的状态以便将来再生的能力。叫作对象的持续性(persistence)。对象通过写出描述自己状态的数值来记录自己 ,这个过程叫对象的串行化(Serialization) 。串行化的主要任务是写出对象实例变量的数值。如果交量是另一对象的引用,则引用的对象也要串行化。这个过程是递归的,串行化可能要涉及一个复杂树结构的单行化,包括原有对象、对象的对象、对象的对象的对象等等。对象所有权的层次结 阅读全文

posted @ 2013-05-25 05:49 Step-BY-Step 阅读(223) 评论(0) 推荐(0) 编辑

TransactionScope

摘要: TransactionScope使用说明TransactionScope是.Net Framework 2.0滞后,新增了一个名称空间。它的用途是为数据库访问提供了一个“轻量级”[区别于:SqlTransaction]的事物。使用之前必须添加对 System.Transactions.dll 的引用。感觉就是锁定某个资源,像是一个mutex。 阅读全文

posted @ 2013-05-25 02:05 Step-BY-Step 阅读(151) 评论(0) 推荐(0) 编辑

git + vs 2012

摘要: 我是如何在GitHub上开源一个项目的(截图说明)起因 我曾经在博客园上和CodePlex开源了自己的【代码生成器】(http://www.cnblogs.com/gossip/archive/2011/11/13/2247154.html, http://codegenerate.codeplex.com/),特别是开源CodePlex的那篇文章有同学建议我用GitHub作为源码控制软件,恰巧我也有这种需求(需要在不同地方的终端更新源代码,之前一直使用金山快盘同步,但无法追溯代码版本,所以决定改为使用GitHub进行代码版本控制) 经过在网上痛苦的一番搜索,最后终于能够实现功能并提交代码,下 阅读全文

posted @ 2013-05-25 02:01 Step-BY-Step 阅读(405) 评论(1) 推荐(0) 编辑

C#中的方括号的语法及作用

摘要: C#中方括号可用于数组,索引、属性,更重要的是用于外部DLL类库的引用。1. C#实现.NET组件与COM组件的互操作 [DllImport("kernel32.dll")]这叫引入kernel32.dll这个动态连接库。这个动态连接库里面包含了很多WindowsAPI函数,如果你想使用这面的函数,就需要这么引入。举个例子:[DllImport("kernel32.dll")]private static extern void 函数名(参数,[参数]);函数名就是一个属于kernel32.dll里的一个函数。完了你就可以用那个函数了。.NET组件中使用 阅读全文

posted @ 2013-05-25 02:00 Step-BY-Step 阅读(3739) 评论(0) 推荐(1) 编辑

Starting C#

摘要: Starting C#:3. 变量和表达式:1.浮点数变量类型:float、double 和decimal。前两种可以用+/-m×2e的形式存储浮点数,m和e的值因类型而异。decimal使用另一种形式:+/- m×10e。2.Console.WriteLine("{0} {1}.", myString, myInteger);输出字符串是"{0} {1}.",它们并没有包含有用的文本。可以看出,这并不是我们运行代码时希望看到的结果,其原因是:字符串实际上是插入变量内容的一个模板,字符串中的每对花括号都是一个占位符,包含列表中每个变量 阅读全文

posted @ 2013-05-25 01:58 Step-BY-Step 阅读(200) 评论(0) 推荐(0) 编辑

using 语句

摘要: using (Font font1 = new Font("Arial", 10.0f)){}备注C# 通过 .NET Framework 公共语言运行库 (CLR) 自动释放用于存储不再需要的对象的内存。内存的释放具有不确定性;一旦 CLR 决定执行垃圾回收,就会释放内存。但是,通常最好尽快释放诸如文件句柄和网络连接这样的有限资源。using 语句允许程序员指定使用资源的对象应当何时释放资源。为 using 语句提供的对象必须实现 IDisposable 接口。此接口提供了 Dispose 方法,该方法将释放此对象的资源。可以在到达 using 语句的末尾时,或者在该语句 阅读全文

posted @ 2013-05-25 01:57 Step-BY-Step 阅读(133) 评论(0) 推荐(0) 编辑

2013年5月22日

start internship today

摘要: start working hahah 阅读全文

posted @ 2013-05-22 04:22 Step-BY-Step 阅读(113) 评论(0) 推荐(0) 编辑

2013年5月4日

POST and PUT

摘要: The fundamental difference between the POST and PUT requests is reflected in the different meaning of the Request-URI. The URI in a POST request identifies the resource that will handle the enclosed entity. That resource might be a data-accepting process, a gateway to some other protocol, or a separ 阅读全文

posted @ 2013-05-04 05:03 Step-BY-Step 阅读(121) 评论(0) 推荐(0) 编辑

2013年4月18日

Pascal's triangle (杨辉三角)

摘要: GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]]没什么特别的, 就是一层一层的做就行了。 时间复杂度是O(n2)。 1 public class Solution { 2 public ArrayList> generate(int numRows) { 3 // Start typing your Java solut... 阅读全文

posted @ 2013-04-18 09:00 Step-BY-Step 阅读(194) 评论(0) 推荐(0) 编辑

2013年4月17日

3 sum

摘要: Given an arraySofnintegers, are there elementsa,b,cinSsuch thata+b+c= 0? Find all unique triplets in the array which gives the sum of zero.Note:Elements in a triplet (a,b,c) must be in non-descending order. (ie,a?b?c)The solution set must not contain duplicate triplets. For example, given array S... 阅读全文

posted @ 2013-04-17 13:20 Step-BY-Step 阅读(181) 评论(0) 推荐(0) 编辑

深入Java,初探JVM

摘要: 转自http://java.chinaitlab.com/base/861921_2.html走进JVM,浅水也能捉鱼! 这不是一篇描述jvm是什么的文章,也不介绍jvm跨平台的特性,也不是讲述jvm安全特性的文章,更不是讲解jvm指令操作,数据运算的文章, 本文重点讲述 类型的生命周期. 类型的生命周期涉及到: 类的装载、jvm体系结构、垃圾回收机制. 为什么要讲jvm体系结构? 因为类的装载和垃圾回收机制都和jvm体系结构息息相关. 那么什么是jvm体系结构呢? 当jvm运行起来的时候,它会向系统申请一片内存区(不同的jvm实现可能不同,有些可以使用虚拟内存),将这块内存分出一部... 阅读全文

posted @ 2013-04-17 08:53 Step-BY-Step 阅读(192) 评论(0) 推荐(0) 编辑

final and static

摘要: 转自http://java.chinaitlab.com/base/724785_2.html一、final 根据程序上下文环境,Java关键字final有“这是无法改变的”或者“终态的”含义,它可以修饰非抽象类、非抽象类成员方法和变量。你可能出于两种理解而需要阻止改变:设计或效率。final类不能被继承,没有子类,final类中的方法默认是final的。final方法不能被子类的方法覆盖,但可以被继承。final成员变量表示常量,只能被赋值一次,赋值后值不再改变。final不能用于修饰构造方法。注意:父类的private成员方法是不能被子类方法覆盖的,因此private类型的方法默认是fin 阅读全文

posted @ 2013-04-17 08:42 Step-BY-Step 阅读(190) 评论(0) 推荐(0) 编辑

Word Ladder 改

摘要: 要求输入最短路径的长度 和 最短路径的个数。。。比如 axy - bxy - dxz axy - cxy - dxz长度为3, 个数 为2. 1 public class Solution { 2 public int ladderLength(String start, String end, HashSet<String> dict) { 3 // Start typing your Java solution below 4 // DO NOT write main() function 5 int len = start.le... 阅读全文

posted @ 2013-04-17 08:13 Step-BY-Step 阅读(171) 评论(0) 推荐(0) 编辑

Word Ladder

摘要: Given two words (startandend), and a dictionary, find the length of shortest transformation sequence fromstarttoend, such that:Only one letter can be changed at a timeEach intermediate word must exist in the dictionaryFor example,Given:start="hit"end="cog"dict=["hot",&q 阅读全文

posted @ 2013-04-17 07:00 Step-BY-Step 阅读(170) 评论(0) 推荐(0) 编辑

2013年4月16日

写给即将入行的程序员的一封信

摘要: 首先,欢迎来到程序员的世界。在这个世界上,不是有很多人想创造软件并解决问题。你是一名hacker,属于那些愿意做一些有挑战性的事情的人。“当你不创造东西时,你只会根据自己的感觉而不是能力去看待问题。” – WhyTheLuckyStiff对于下面的文字你不必完全接受,所有这些来自一个其貌不扬的程序员。我喜欢把事情做到最好,而不是对原来的东西修修补补。仅仅是因为爱好开始做一些创新,这是一个很好的开始!如果你说“我要先学习一下再开始做”那么你永远不会真正开始。每个人都需要从某个地方开始,所以现在打开你的编辑器开始写代码吧。下面是一些很重要的建议,虽然有人并不认同,但我保证你看完我的分析以后会站在我 阅读全文

posted @ 2013-04-16 14:25 Step-BY-Step 阅读(116) 评论(0) 推荐(0) 编辑

Sum Root to Leaf Numbers

摘要: Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which represents the number123.Find the total sum of all root-to-leaf numbers.For example, 1 / \ 2 3The root-to-leaf path1->2represents the number12.T 阅读全文

posted @ 2013-04-16 14:14 Step-BY-Step 阅读(128) 评论(0) 推荐(0) 编辑

Palindrome Partitioning II 改进

摘要: Given a strings, partitionssuch that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning ofs.For example, givens="aab",Return1since the palindrome partitioning["aa","b"]could be produced using 1 cut.维护两张表,一张一维的表是 阅读全文

posted @ 2013-04-16 12:45 Step-BY-Step 阅读(221) 评论(0) 推荐(0) 编辑

Palindrome Partitioning II

摘要: Given a strings, partitionssuch that every substring of thepartition is a palindrome.Return the minimum cutsneeded for a palindrome partitioning ofs.F... 阅读全文

posted @ 2013-04-16 07:35 Step-BY-Step 阅读(217) 评论(0) 推荐(0) 编辑

Reverse Integer

摘要: Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321Have you thought about this?Here are some good questions to ask... 阅读全文

posted @ 2013-04-16 04:15 Step-BY-Step 阅读(226) 评论(0) 推荐(0) 编辑

字符串的排列

摘要: 题目:输入一个字符串,打印出该字符串中字符的所有排列。例如输入字符串abc,则输出由字符a、b、c所能排列出来的所有字符串abc、acb、bac、bca、cab和cba。 1 public void putall(String s){ 2 StringBuffer ss = new StringBuffer(s); 3 int pointer = 0; 4 outputK(ss,pointer); 5 } 6 public void outputK(StringBuffer s, int pointer){ 7 ... 阅读全文

posted @ 2013-04-16 03:29 Step-BY-Step 阅读(141) 评论(0) 推荐(0) 编辑

2013年4月15日

Permutation Sequence, Solution

摘要: The set [1,2,3,…,n] contains a total of n! unique permutations.By listing and labeling all of the permutations in order, We get the following sequence (ie, for n = 3):"123""132""213""231""312""321"Given n and k, return the kth permutation s 阅读全文

posted @ 2013-04-15 07:29 Step-BY-Step 阅读(210) 评论(0) 推荐(0) 编辑

2013年4月13日

Kadane's Algorithm

摘要: Kadane's Algorithmis anO(n)algorithm for finding the maximum contiguoussubsequencein a one-dimensionalsequence.[edit]PseudocodeThe algorithm keeps track of the tentative maximum subsequence in(maxSum, maxStartIndex, maxEndIndex). It accumulates a partial sum incurrentMaxSumand updates the optima 阅读全文

posted @ 2013-04-13 12:27 Step-BY-Step 阅读(324) 评论(0) 推荐(0) 编辑

Maximum Sum (二维)

摘要: 108 - Maximum Sumhttp://online-judge.uva.es/p/v1/108.htmlQuite similar to 10074 and 10667.[edit]SummaryGiven annbyntwo-dimensional arrayarr(1 < =n< = 100) of arbitrary integers, find the maximum sub-array. Maximum sub-array is defined to be the sub-array whose sum of integer elements are the m 阅读全文

posted @ 2013-04-13 12:23 Step-BY-Step 阅读(201) 评论(0) 推荐(0) 编辑

Chp1: Arrays and Strings

摘要: HashTableArrayLinkedListBinary Search TreeArrayListStringBuffer 阅读全文

posted @ 2013-04-13 02:12 Step-BY-Step 阅读(105) 评论(0) 推荐(0) 编辑

2013年4月12日

Chp8: Object-Oriented Design

摘要: How to Approach OOD: 阅读全文

posted @ 2013-04-12 14:45 Step-BY-Step 阅读(94) 评论(0) 推荐(0) 编辑

2013年4月11日

什么是老实人

摘要: 1、老实人一般胆小怕事,安分守己,对人对事谨小慎微,从不会随便得罪别人,即使别人得罪了自己,也不会记恨在心,更不会以牙还牙。对于别人的一点点恩惠,也牢记心中找机会给予报答。2、老实人只与合得来的人交往,不看对方的身份和地位,也不指望对方给自己带来什么实际利益,它只是出于一种精神的需要,带有情绪化的特征。这种处世方式带有很明显的书生气,自以为清高有境界,结果只能是离群索居,被人孤立,处处吃亏。3、老实人往往不懂得掩饰自己的情绪,也不管时间场合,对象是否适当,更不理会讲话的后果,心里有啥就说啥,想说啥就说啥。而且,说出话来不讲究方式方法,往往是采取最直露的表达方式,甚至不乏尖锐刻薄。老实人的直率最 阅读全文

posted @ 2013-04-11 08:14 Step-BY-Step 阅读(3532) 评论(0) 推荐(0) 编辑

[留学生涯] 留学生倾情总结:在美国不可不知道的100件事!

摘要: 赴美留学遇到的最大问题除了语言上的生疏感之外,可能最重要的就是生活细节上的了解与习惯了。下面一位在美国读大学的朋友将自己的经验与网上信息进行整理,列出了整整100条美国留学生活上的注意事项,希望可以对即将赴美留学的同学们有点帮助! 1.洗手间里的马桶叫toilet。家里的洗手间叫bathroom。外面的洗手间叫restroom。 2.吃饭要给小费,一般给消费数额的10%--15% ,快餐厅不给小费 。 3.商店售货员态度都特别好,第一句话是how are you today,这时应该很自然地回答good,她会说nice,然后说if there is any problem please... 阅读全文

posted @ 2013-04-11 08:00 Step-BY-Step 阅读(160) 评论(0) 推荐(0) 编辑

坦白从宽,牢底坐穿?留学生如何应对美警察审问~~

摘要: 以下信息仅针对美国,不适用于中国大陆地区,否则死无葬身之地。 Disclaimer: The following article is provided for information purposes only and is not to be construed as actual legal advice nor take the place of legal counsel. 说道审问,我想首先我们要讲清楚什么是审问。举个例子,你在高速上超速了,警察在你后面闪着警灯让你停下。这下面发生的所有对话,哪怕是向你要驾照,都属于审问的范畴。你们的所有对话,都有可能日后成为陈堂证供。很多人在这. 阅读全文

posted @ 2013-04-11 07:49 Step-BY-Step 阅读(1982) 评论(0) 推荐(0) 编辑

2013年3月31日

Ubuntu中的挂载点(mount point)

摘要: 转载自: http://www.cnblogs.com/taoxu0903/archive/2008/01/19/1045627.html在Ubuntu系统的安装过程中,您需要选择系统目录的挂载点。我们知道,安装Windows时,我们可以选择把系统安装在哪一个分区,把系统挂载到分区上。而在Ubuntu/Linux中则相反,我们要把分区挂载到系统中。当我们使用Windows的安装方式,把系统挂载到分区上,我们就不可能把Windows目录放在C盘,而把MyDocuments目录放到其它分区。您或者出于习惯,或者出于数据安全方面的考虑,通常把文档放到其它分区中。但是Windows下很多软件保存文件的 阅读全文

posted @ 2013-03-31 06:48 Step-BY-Step 阅读(519) 评论(0) 推荐(0) 编辑

2013年3月29日

A Distance Maximizing Problem

摘要: Given an array A of integers, findthe maximum of j-i subjected to the constraint of A[i] < A[j].发现这三天做的题目都是一个类型的。 就是采用一个header 一个 tail 指针 同时卡 一个array的两个边界 来在O(n) 的时间内 完成 brute force 需要O(n2) 才能完成的任务。这类问题的相似处都是找max, 采用的 也都是 先移动tail, 当不能移动tail时, 移动header 来动态的控制边界。 阅读全文

posted @ 2013-03-29 07:23 Step-BY-Step 阅读(344) 评论(0) 推荐(0) 编辑

2013年3月28日

Longest Substring Without Repeating Characters

摘要: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for “abcabcbb” is “abc”, which the length is 3. For “bbbbb” the longest substring is “b”, with the length of 1. 1 public class Solution { 2 public i... 阅读全文

posted @ 2013-03-28 06:42 Step-BY-Step 阅读(277) 评论(0) 推荐(0) 编辑

最长子串算法优化。。

摘要: 想要降低时间复杂度,从brace 的 N2 变成 N。 肯定要引用两个指针,一个指向头一个指向尾,然后bundle的 来改变这两个指针的位置 已获得需要的数据。。。 适用于最长子串,最需要的子串这一类的 问题。 阅读全文

posted @ 2013-03-28 06:09 Step-BY-Step 阅读(128) 评论(0) 推荐(0) 编辑

上一页 1 ··· 9 10 11 12 13 14 下一页

导航