在学javacc的时候,发现一个问题,见下:
Example.jj文件
PARSER_BEGIN(Example)
public class Example {
public static void main(String args[]) throws ParseException {
Example parser = new Example(System.in);
...
分类:
编程语言 时间:
2014-05-14 01:25:59
阅读次数:
367
asp.net 实现“九连环”小游戏
wildcatsky(原作)
public Class ChinaRing1
Inherits System.Web.UI.Page
#Region " Web 窗体设计器生成的代码 "
'该调用是 Web 窗体设计器所必需的。
Private Sub InitializeComponent()
End Sub
Protected Wi...
分类:
Web程序 时间:
2014-05-14 00:30:45
阅读次数:
390
//导出到word
public void exportWord(ActionMapping actionMapping, ActionForm actionForm,
HttpServletRequest request, HttpServletResponse response) throws Exception {
DBTool tool = null ;...
分类:
编程语言 时间:
2014-05-13 23:57:53
阅读次数:
509
Pat1018代码
题目描述:
There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One may rent a bike at any station and return it to an...
分类:
其他好文 时间:
2014-05-13 23:27:04
阅读次数:
582
导入两个包:
import android.view.Window;
import android.view.WindowManager;
public class MainActivity extends ActionBarActivity {@Override protected void onCreate(Bundle savedInstanceState) { super.onCrea...
分类:
移动开发 时间:
2014-05-13 23:19:51
阅读次数:
509
一概念
serversocket实现了服务端的socket,一个服务端的socket等待从网络上发来的请求,并基于这个请求作出
响应的操作,并作出回应结果。
serversocket 建立的是socket的服务端,socket建立的是客户端。最主要构造方法:
public ServerSocket():创建一个未绑定任何端口的套接字
public ServerSocket(in...
分类:
编程语言 时间:
2014-05-13 08:15:18
阅读次数:
321
二进制相加,本质上就是大整数加法,有关大整数加法我的舍友教过我一个很好的方法,先用一个int数组保存结果,将两个数对应位置相加,全部加完后,再统一处理进位的问题。这个方法同样适用于大整数的乘法。
这个题没什么特别的,注意一下进位别搞错了就行了,还有其实不用像我写的这么麻烦,可以一开始先判断哪个更长一些,交换一下。代码会简洁很多。class Solution {
public:
strin...
分类:
其他好文 时间:
2014-05-13 08:02:00
阅读次数:
239
1、当你想并发去执行一段代码,但是还想获取这段代码的返回结果,那么future多线程模式就可以派上用场了,代码实现如下。publicclassClient{
publicDatarequest(){
finalFutureDatafutureData=newFutureData();
newThread(newRunnable(){
@Override
publicvoidrun(){
futureDat..
分类:
编程语言 时间:
2014-05-13 01:29:02
阅读次数:
405
首先由三个类分别为DateType(日期类)、TimeType(时间类)、DateTimeType(日期时间内)。具体代码如下:
#include
using namespace std;
class DateType
{
int year,month,day;
public:
DateType(int year = 2000,int month = 12,int day = 1)
{...
分类:
编程语言 时间:
2014-05-12 23:03:54
阅读次数:
430
#include
//using namespace std;
class Matrix
{
public:
Matrix();
friend Matrix operator+(Matrix &,Matrix &);
friend ostream& operator
friend istream& operator>>(istream&,Matri...
分类:
其他好文 时间:
2014-05-12 22:39:15
阅读次数:
387