在学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
题目
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.
For "(()", the longest valid parentheses substring is "()", ...
分类:
其他好文 时间:
2014-05-14 01:10:30
阅读次数:
318
int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
void FD_CLR(int fd, fd_set *set);
int FD_ISSET(int fd, fd_set *set);
void FD_SET(int fd, fd...
分类:
其他好文 时间:
2014-05-14 00:03:02
阅读次数:
440
recv函数会将套接字缓冲区中的内容读出,但不清空,与read函数的区别在此。此函数有一个flag标志位,设为MSG_PEEK。
send函数会将缓冲区中的内容写入到套接字,也不清空,与write函数的区别在此。
用这两个函数可以先接收或发送缓冲区中的内容,然后再用readn(此时缓冲区中的内容依然存在)与write函数去继续判断换行符/n,对缓冲区内容实现换行输出。
echocli.c...
分类:
其他好文 时间:
2014-05-13 23:43:35
阅读次数:
494
/*
ID:kevin_s1
PROG:dualpal
LANG:C++
*/
#include
#include
#include
#include
#include
using namespace std;
int N,S;
vector result;
bool isPalindromic(string num){
bool flag = true;
int len =...
分类:
其他好文 时间:
2014-05-13 06:10:09
阅读次数:
312
whileCONDITION;dostatementdone进入循环:条件满足退出循环:条件不满足untilCONDITION;dostatment...done#!/bin/bash#read-p"Inputsomething:"STRINGwhile[$STRING!=‘quit‘];doecho$STRING|tr‘a-z‘‘A-Z‘read-p"Inputsomething:"STRINGdone#!/bin/bash#read-p"Inputsomething:..
分类:
系统相关 时间:
2014-05-13 03:58:53
阅读次数:
343
集合:泛型基础知识泛型。(泛型就是类型参数化,默认的时object,虽然不用强制类型转换,这个就要你自己去写特性方法,比如compareto是string的特有方法吧,你可以写但是父类肯定调用不了)itnext对象都是obj要使用对象的特性功能必须强。编译的时候没问题,因为都不知道你会..
分类:
其他好文 时间:
2014-05-13 03:02:23
阅读次数:
235
#!/usr/bin/envpython#coding:utf8#随机生成自定义长度密码fromrandomimportchoiceimportstring,pickledefGenPassword(length=8,chars=string.ascii_letters+string.digits):return‘‘.join([choice(chars)foriinrange(length)])defpasslist(r_user,c_user,ip_list,web_list):di..
分类:
编程语言 时间:
2014-05-13 01:25:56
阅读次数:
505
atitit. hb 原生sql跨数据库解决原理 获得hb 数据库类型运行期获得Dialect
#-----原理
Hibernate 运行期获得Dialect
2010-07-28 12:59:58| 分类: 软件开发 |举报 |字号 订阅
String dialect = ((SessionFactoryImpl) session.getSessio...
分类:
数据库 时间:
2014-05-12 23:35:43
阅读次数:
411
2.0 简介
正则表达式是可以用来查找与给定模式匹配的文本的搜索模式。例如,在上一章中,我们在一个较长的字符串中查找子字符串Cookbook:
var testValue = "This is the Cookbook's test string";
var subsValue = "Cookbook";
var iValue = testValue.indexOf(subsVal...
分类:
编程语言 时间:
2014-05-12 23:26:34
阅读次数:
635