“初始化 定义 赋值” 之间的联系与区别
本来很早之前就想写个blog,说说这三个家伙的区别和联系,三者之间各种联系,很难比较清楚的讲明白,感觉当时好像分析思路还不够“完整”。今天遇到别人抛出来的一个问题。根本的问题是和初始化和赋值有关系,于是留下这个blog。
#include
struct _ANIBMP
{
int FirstNu...
分类:
其他好文 时间:
2014-07-22 23:04:54
阅读次数:
384
在浏览器与服务器进行交互时,往往需要把涉及到的一些数据保存下来,这时就需要使用cookie或session进行状态管理。
这篇文章先来说说session怎么用,首先在servlet中创建一个session来保存信息,举个例子,在做登陆验证时,如果登陆成功,需要将用户的信息保存到session中,怎么保存呢?下面给出代码:
public class Login_Do extends HttpS...
分类:
Web程序 时间:
2014-07-22 23:03:52
阅读次数:
355
表
a = { }
b = { x = 1, ["hello, "] = "world!" }
a.astring = "ni, hao!"
a[1] = 100
a["a table"] = b
function foo()
end
function bar()
end
a[foo] = bar
--分别穷举表a和b
for k, v in pairs(a) do
print(k, "=>",...
分类:
其他好文 时间:
2014-07-22 23:00:33
阅读次数:
261
题目链接:
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5170
Attack on Titans
Time Limit: 2 Seconds Memory Limit: 65536 KB
Over centuries ago, mankind faced a new enemy, th...
分类:
其他好文 时间:
2014-07-22 23:00:16
阅读次数:
536
程序自动产生随机数(srand 设置种子为系统时间,以保证每次运行程序产生的随机数有差别
),然后用户输入结果,程序判断用户输入是否正确减法运算时要保证随机产生的a要大于b(用while循环判断,当然前提条件是用户选择的为减法运算,这里只保证式子产生的结果为非负整数)。#include
#inclu...
分类:
其他好文 时间:
2014-05-01 23:59:45
阅读次数:
499
Problem DescriptionIgnatius has just come back
school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher
gives him a deadline o...
分类:
其他好文 时间:
2014-05-01 20:49:40
阅读次数:
563
这个五月份,what will to
do?1、软件设计师考试2、英语六级考试3、暑假的实习前几天的教训,不会忘记,现在总会有那么一种模式叫做“许冰模式”。所有的语言都是苍白的,即使我们可以尽情的洋洋洒洒的描述,但是,最后提取的关键字,就是那几个名词,刺眼的名词,我会用实际行动去表达。还是那一句:做...
分类:
其他好文 时间:
2014-05-01 19:56:40
阅读次数:
334
Determine whether an integer is a palindrome.
Do this without extra space.Some hints:Could negative integers be palindromes?
(ie, -1)If you are thinki...
分类:
其他好文 时间:
2014-05-01 19:48:19
阅读次数:
344
You are given an n x n 2D matrix representing an image.
Rotate the image by 90 degrees (clockwise).
Follow up:
Could you do this in-place?
刚开始没有思路,但是自己举了几个简单的栗子才看出规律:需要一圈儿一圈儿的变换位置。有两层for循环:外...
分类:
其他好文 时间:
2014-05-01 18:33:34
阅读次数:
359
1. 调用其他的.lua文件 dofile("xx.lua");
2. 避免用 "_VERSION"这类的标识符,Lua将这类标识符用作特殊用途,通常保留"_"作为”哑变量“
3. Lua的一些保留字:
do in local nil until 等
4. 注释:-- 表示行注释 --[[ ... ]] 表示块注释
一般的块注释这样写:
--[[
...
分类:
其他好文 时间:
2014-04-30 22:34:38
阅读次数:
270