怀旧系列(1)----FBasic - 程晨 - 博客园
随笔 - 28, 文章 - 0, 评论 - 61, 引用 - 0
小时候,老爸斥巨资给我买了一台小霸王学习机。玩遍了所有游戏后,里面有个F-Basic语言,黑乎乎的,一点也不好玩。直到杰兄从学校带回一本BASIC语言,才知道这玩意儿还可以编辑**图案。由于没有人指导,逻辑思维简单。也只会编写**图案,或者乘法口诀之类简单程序。但这就是启蒙。
后来才发现,我家的小霸王卡带上只有F-Basic,这里并不是Family-Basic的缩写,而是用于科学计算的浮点运算。要知道那个时候红白机的CPU是不支持浮点运算的,而此Basic是一种模拟运算。而同学家的卡带上有G-Baisc 和F-Baisc两种。这里的G-Basic是指Game-Basic其实就是任天堂的Family Baisc v2.0。很遗憾当时没有接触到G-Basic,要不然也可以把超级玛丽的图案拉出来玩玩。
现在只能用模拟器在电脑上回味F-Basic了。如果只是简单的用FC模拟器来玩,一点都没有意思。不如自己写一个简单的Basic语言,只要能解析简单的命令,那么这样才好玩。于是SkyBasic诞生了。
这些程序代表了我在1996年左右的代码编写能力。>> BasicFamilyParser.java
BasicFamilyParser.java ( 文件浏览 )
* LumaQQ - Java QQ Client
* Copyright (C) 2004 luma &&
* This prog you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software F either version 2 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* alo if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
package edu.tsinghua.lumaqq.qq.
import java.nio.ByteB
import edu.tsinghua.lumaqq.qq.QQ;
import edu.tsinghua.lumaqq.qq.beans.QQU
import edu.tsinghua.lumaqq.qq.packets.in.AddFriendAuthResponseReplyP
import edu.tsinghua.lumaqq.qq.packets.in.AddFriendExReplyP
import edu.tsinghua.lumaqq.qq.packets.in.AdvancedSearchUserReplyP
import edu.tsinghua.lumaqq.qq.packets.in.AuthInfoOpReplyP
import edu.tsinghua.lumaqq.qq.packets.in.AuthQuestionOpReplyP
import edu.tsinghua.lumaqq.qq.packets.in.AuthorizeReplyP
import edu.tsinghua.lumaqq.qq.packets.in.ChangeStatusReplyP
import edu.tsinghua.lumaqq.qq.packets.in.ClusterCommandReplyP
import edu.tsinghua.lumaqq.qq.packets.in.DeleteFriendReplyP
import edu.tsinghua.lumaqq.qq.packets.in.DownloadGroupFriendReplyP
import edu.tsinghua.lumaqq.qq.packets.in.FriendChangeStatusP
import edu.tsinghua.lumaqq.qq.packets.in.FriendDataOpReplyP
import edu.tsinghua.lumaqq.qq.packets.in.FriendLevelOpReplyP
import edu.tsinghua.lumaqq.qq.packets.in.GetFriendListReplyP
import edu.tsinghua.lumaqq.qq.packets.in.GetOnlineOpReplyP
import edu.tsinghua.lumaqq.qq.packets.in.GetTempClusterOnlineMemberReplyP
import edu.tsinghua.lumaqq.qq.packets.in.GetUserInfoReplyP
import edu.tsinghua.lumaqq.qq.packets.in.GroupDataOpReplyP
import edu.tsinghua.lumaqq.qq.packets.in.KeepAliveReplyP
import edu.tsinghua.lumaqq.qq.packets.in.LoginReplyP
import edu.tsinghua.lumaqq.qq.packets.in.ModifyInfoReplyP
import edu.tsinghua.lumaqq.qq.packets.in.PrivacyDataOpReplyP
import edu.tsinghua.lumaqq.qq.packets.in.ReceiveIMP
import edu.tsinghua.lumaqq.qq.packets.in.RemoveSelfReplyP
import edu.tsinghua.lumaqq.qq.packets.in.GetKeyReplyP
import edu.tsinghua.lumaqq.qq.packets.in.GetLoginTokenReplyP
import edu.tsinghua.lumaqq.qq.packets.in.SearchUserReplyP
import edu.tsinghua.lumaqq.qq.packets.in.SendIMReplyP
import edu.tsinghua.lumaqq.qq.packets.in.SendSMSReplyP
import edu.tsinghua.lumaqq.qq.packets.in.SignatureOpReplyP
import edu.tsinghua.lumaqq.qq.packets.in.SystemNotificationP
import edu.tsinghua.lumaqq.qq.packets.in.TempSessionOpReplyP
import edu.tsinghua.lumaqq.qq.packets.in.UnknownInP
import edu.tsinghua.lumaqq.qq.packets.in.UploadGroupFriendReplyP
import edu.tsinghua.lumaqq.qq.packets.in.UserPropertyOpReplyP
import edu.tsinghua.lumaqq.qq.packets.in.WeatherOpReplyP
import edu.tsinghua.lumaqq.qq.packets.out.AddFriendAuthResponseP
import edu.tsinghua.lumaqq.qq.packets.out.AddFriendExP
import edu.tsinghua.lumaqq.qq.packets.out.AdvancedSearchUserP
import edu.tsinghua.lumaqq.qq.packets.out.AuthInfoOpP
import edu.tsinghua.lumaqq.qq.packets.out.AuthQuestionOpP
import edu.tsinghua.lumaqq.qq.packets.out.AuthorizeP
import edu.tsinghua.lumaqq.qq.packets.out.ChangeStatusP
import edu.tsinghua.lumaqq.qq.packets.out.ClusterCommandP
import edu.tsinghua.lumaqq.qq.packets.out.DeleteFriendP
import edu.tsinghua.lumaqq.qq.packets.out.DownloadGroupFriendP
import edu.tsinghua.lumaqq.qq.packets.out.FriendDataOpP
import edu.tsinghua.lumaqq.qq.packets.out.FriendLevelOpP
import edu.tsinghua.lumaqq.qq.packets.out.GetFriendListP
import edu.tsinghua.lumaqq.qq.packets.out.GetOnlineOpP
import edu.tsinghua.lumaqq.qq.packets.out.GetUserInfoP
import edu.tsinghua.lumaqq.qq.packets.out.GroupDataOpP
import edu.tsinghua.lumaqq.qq.packets.out.KeepAliveP
import edu.tsinghua.lumaqq.qq.packets.out.LoginP
import edu.tsinghua.lumaqq.qq.packets.out.LogoutP
import edu.tsinghua.lumaqq.qq.packets.out.ModifyInfoP
import edu.tsinghua.lumaqq.qq.packets.out.PrivacyDataOpP
import edu.tsinghua.lumaqq.qq.packets.out.ReceiveIMReplyP
import edu.tsinghua.lumaqq.qq.packets.out.RemoveSelfP
import edu.tsinghua.lumaqq.qq.packets.out.GetKeyP
import edu.tsinghua.lumaqq.qq.packets.out.GetLoginTokenP
import edu.tsinghua.lumaqq.qq.packets.out.SearchUserP
import edu.tsinghua.lumaqq.qq.packets.out.SendIMP
import edu.tsinghua.lumaqq.qq.packets.out.SendSMSP
import edu.tsinghua.lumaqq.qq.packets.out.SignatureOpP
import edu.tsinghua.lumaqq.qq.packets.out.TempSessionOpP
import edu.tsinghua.lumaqq.qq.packets.out.UnknownOutP
import edu.tsinghua.lumaqq.qq.packets.out.UploadGroupFriendP
import edu.tsinghua.lumaqq.qq.packets.out.UserPropertyOpP
import edu.tsinghua.lumaqq.qq.packets.out.WeatherOpP
* 基本协议族解析器
* @author luma
public class BasicFamilyParser implements IParser {
private PacketH
public BasicFamilyParser() {
history = new PacketHistory();
/* (non-Javadoc)
* @see edu.tsinghua.lumaqq.qq.packets.IParser#accept(java.nio.ByteBuffer)
public boolean accept(ByteBuffer buf) {
// 保存偏移
offset = buf.position();
int bufferLength = buf.limit() - buf.position();
if(bufferLength &= 0)
boolean accept = checkTcp(buf);
if(!accept)
accept = checkUdp(buf);
* 检查一个包是否是udp包
* @param buf
ByteBuffer
true表示是,false表示否
private boolean checkUdp(ByteBuffer buf) {
if(buf.get(offset) == QQ.QQ_HEADER_BASIC_FAMILY) {
// 首先检查是否UDP方式
length = buf.limit() - buf.position();
if(buf.get(offset + length - 1) == QQ.QQ_TAIL_BASIC_FAMILY)
* 检查一个包是否是tcp包
* @param buf
ByteBuffer
true表示是
private boolean checkTcp(ByteBuffer buf) {
// buffer length不大于2则连个长度字段都没有
int bufferLength = buf.limit() - buf.position();
if(bufferLength & 2)
// 如果可读内容小于包长,则这个包还没收完
length = buf.getChar(offset);
if(length &= 0 || length & bufferLength)
// 再检查包头包尾
if(buf.get(offset + 2) == QQ.QQ_HEADER_BASIC_FAMILY) {
if(buf.get(offset + length - 1) == QQ.QQ_TAIL_BASIC_FAMILY)
public int getLength(ByteBuffer buf) {
public boolean isDuplicate(InPacket in) {
return history.check(in, true);
* 得到包的命令和序号
* @param buf
private char getCommand(ByteBuffer buf, QQUser user) {
if(!user.isUdp()) {
return buf.getChar(offset + 5);
return buf.getChar(offset + 3);
/* (non-Javadoc)
* @see edu.tsinghua.lumaqq.qq.packets.IParser#parseIncoming(java.nio.ByteBuffer, int, edu.tsinghua.lumaqq.qq.beans.QQUser)
public InPacket parseIncoming(ByteBuffer buf, int len, QQUser user) throws PacketParseException {
switch(getCommand(buf, user)) {
case QQ.QQ_CMD_GET_LOGIN_TOKEN:
return new GetLoginTokenReplyPacket(buf, len, user);
case QQ.QQ_CMD_KEEP_ALIVE:
return new KeepAliveReplyPacket(buf, len, user);
case QQ.QQ_CMD_MODIFY_INFO:
return new ModifyInfoReplyPacket(buf, len, user);
case QQ.QQ_CMD_ADD_FRIEND_EX:
return new AddFriendExReplyPacket(buf, len, user);
case QQ.QQ_CMD_AUTH_QUESTION_OP:
return new AuthQuestionOpReplyPacket(buf, len, user);
case QQ.QQ_CMD_AUTH_INFO_OP:
return new AuthInfoOpReplyPacket(buf, len, user);
case QQ.QQ_CMD_SEARCH_USER:
return new SearchUserReplyPacket(buf, len, user);
case QQ.QQ_CMD_DELETE_FRIEND:
return new DeleteFriendReplyPacket(buf, len, user);
case QQ.QQ_CMD_REMOVE_SELF:
return new RemoveSelfReplyPacket(buf, len, user);
case QQ.QQ_CMD_ADD_FRIEND_AUTH:
return new AddFriendAuthResponseReplyPacket(buf, len, user);
case QQ.QQ_CMD_GET_USER_INFO:
return new GetUserInfoReplyPacket(buf, len, user);
case QQ.QQ_CMD_CHANGE_STATUS:
return new ChangeStatusReplyPacket(buf, len, user);
case QQ.QQ_CMD_SEND_IM:
return new SendIMReplyPacket(buf, len, user);
case QQ.QQ_CMD_RECV_IM:
return new ReceiveIMPacket(buf, len, user);
case QQ.QQ_CMD_LOGIN:
return new LoginReplyPacket(buf, len, user);
case QQ.QQ_CMD_GET_FRIEND_LIST:
return new GetFriendListReplyPacket(buf, len, user);
case QQ.QQ_CMD_GET_ONLINE_OP:
return new GetOnlineOpReplyPacket(buf, len, user);
case QQ.QQ_CMD_RECV_MSG_SYS:
return new SystemNotificationPacket(buf, len, user);
case QQ.QQ_CMD_RECV_MSG_FRIEND_CHANGE_STATUS:
return new FriendChangeStatusPacket(
(文件超长,未完全显示,请下载后阅读剩余部分)
展开> <收缩
下载源码到电脑,阅读使用更方便
还剩0行未阅读,继续阅读 ?
Sponsored links
源码文件列表
温馨提示: 点击源码文件名可预览文件内容哦 ^_^
66.49 kB09-04-07 09:47
1.88 kB09-04-07 09:47
2.16 kB09-04-07 09:47
1.24 kB09-04-07 09:47
3.95 kB09-04-07 09:47
5.27 kB09-04-07 09:47
11.05 kB09-04-07 09:47
1.22 kB09-04-07 09:47
1.69 kB09-04-07 09:47
1.80 kB09-04-07 09:47
2.22 kB09-04-07 09:47
6.23 kB09-04-07 09:47
1.41 kB09-04-07 09:47
1.77 kB09-04-07 09:47
2.24 kB09-04-07 09:47
2.28 kB09-04-07 09:47
1.45 kB09-04-07 09:47
6.47 kB09-04-07 09:47
2.93 kB09-04-07 09:47
3.07 kB09-04-07 09:47
1.19 kB09-04-07 09:47
12.53 kB09-04-07 09:47
2.08 kB09-04-07 09:47
1.29 kB09-04-07 09:47
1.33 kB09-04-07 09:47
3.56 kB09-04-07 09:47
1.97 kB09-04-07 09:47
1.89 kB09-04-07 09:47
1.96 kB09-04-07 09:47
1.51 kB09-04-07 09:47
1.44 kB09-04-07 09:47
1.77 kB09-04-07 09:47
17.56 kB09-04-07 09:47
2.12 kB14-01-08 09:19
6.50 kB14-01-08 09:19
1.34 kB09-04-07 09:47
1.25 kB09-04-07 09:47
1.16 kB09-04-07 09:47
40.86 kB09-04-07 09:47
1.09 kB09-04-07 09:47
3.62 kB09-04-07 09:47
1.44 kB09-04-07 09:47
1.79 kB09-04-07 09:47
4.05 kB09-04-07 09:47
1.39 kB09-04-07 09:47
4.73 kB09-04-07 09:47
1,018.00 B09-04-07 09:47
1.69 kB09-04-07 09:47
1.62 kB09-04-07 09:47
16.85 kB09-04-07 09:47
5.33 kB09-04-07 09:47
5.86 kB09-04-07 09:47
2.69 kB09-04-07 09:47
2.16 kB09-04-07 09:47
2.38 kB09-04-07 09:47
3.46 kB09-04-07 09:47
2.88 kB09-04-07 09:47
1.72 kB09-04-07 09:47
2.78 kB09-04-07 09:47
2.07 kB09-04-07 09:47
28.56 kB09-04-07 09:47
2.06 kB09-04-07 09:47
3.49 kB09-04-07 09:47
2.78 kB09-04-07 09:47
5.46 kB09-04-07 09:47
2.35 kB09-04-07 09:47
2.98 kB09-04-07 09:47
2.79 kB09-04-07 09:47
4.07 kB09-04-07 09:47
3.31 kB09-04-07 09:47
2.42 kB09-04-07 09:47
2.50 kB09-04-07 09:47
3.67 kB09-04-07 09:47
2.41 kB09-04-07 09:47
6.04 kB09-04-07 09:47
2.27 kB09-04-07 09:47
1.72 kB09-04-07 09:47
27.54 kB09-04-07 09:47
2.01 kB09-04-07 09:47
3.01 kB09-04-07 09:47
2.00 kB09-04-07 09:47
3.79 kB09-04-07 09:47
2.70 kB09-04-07 09:47
6.83 kB09-04-07 09:47
2.24 kB09-04-07 09:47
1.79 kB09-04-07 09:47
2.03 kB09-04-07 09:47
2.57 kB09-04-07 09:47
3.29 kB09-04-07 09:47
2.58 kB09-04-07 09:47
2.25 kB09-04-07 09:47
1.43 kB09-04-07 09:47
3.33 kB09-04-07 09:47
2.49 kB09-04-07 09:47
2.13 kB09-04-07 09:47
3.92 kB09-04-07 09:47
1.82 kB09-04-07 09:47
1.92 kB09-04-07 09:47
2.89 kB09-04-07 09:47
3.50 kB09-04-07 09:47
2.38 kB09-04-07 09:47
6.12 kB09-04-07 09:47
3.80 kB09-04-07 09:47
6.09 kB09-04-07 09:47
3.24 kB09-04-07 09:47
2.67 kB09-04-07 09:47
2.19 kB09-04-07 09:47
2.92 kB09-04-07 09:47
3.40 kB09-04-07 09:47
4.76 kB09-04-07 09:47
2.72 kB09-04-07 09:47
2.71 kB09-04-07 09:47
5.24 kB09-04-07 09:47
3.79 kB09-04-07 09:47
1.66 kB09-04-07 09:47
2.09 kB09-04-07 09:47
2.89 kB09-04-07 09:47
2.10 kB09-04-07 09:47
1.95 kB09-04-07 09:47
2.14 kB09-04-07 09:47
3.47 kB09-04-07 09:47
2.16 kB09-04-07 09:47
2.92 kB09-04-07 09:47
2.10 kB09-04-07 09:47
2.37 kB09-04-07 09:47
4.96 kB09-04-07 09:47
2.80 kB09-04-07 09:47
2.79 kB09-04-07 09:47
3.78 kB09-04-07 09:47
2.96 kB09-04-07 09:47
9.39 kB09-04-07 09:47
5.73 kB09-04-07 09:47
2.73 kB09-04-07 09:47
2.30 kB09-04-07 09:47
2.41 kB09-04-07 09:47
1.83 kB09-04-07 09:47
2.47 kB09-04-07 09:47
2.64 kB09-04-07 09:47
8.27 kB09-04-07 09:47
3.30 kB09-04-07 09:47
2.92 kB09-04-07 09:47
2.47 kB09-04-07 09:47
4.22 kB09-04-07 09:47
3.69 kB09-04-07 09:47
2.32 kB09-04-07 09:47
4.71 kB09-04-07 09:47
2.29 kB09-04-07 09:47
4.43 kB09-04-07 09:47
2.06 kB09-04-07 09:47
3.99 kB09-04-07 09:47
2.23 kB09-04-07 09:47
2.26 kB09-04-07 09:47
2.45 kB09-04-07 09:47
4.83 kB09-04-07 09:47
19.19 kB09-04-07 09:47
8.62 kB09-04-07 09:47
3.60 kB09-04-07 09:47
7.32 kB09-04-07 09:47
1.89 kB09-04-07 09:47
3.29 kB09-04-07 09:47
2.38 kB09-04-07 09:47
2.29 kB09-04-07 09:47
3.10 kB09-04-07 09:47
2.55 kB09-04-07 09:47
1.56 kB09-04-07 09:47
4.11 kB09-04-07 09:47
3.62 kB09-04-07 09:47
3.18 kB09-04-07 09:47
7.85 kB09-04-07 09:47
1.82 kB09-04-07 09:47
6.19 kB09-04-07 09:47
13.41 kB09-04-07 09:47
8.50 kB09-04-07 09:47
5.38 kB09-04-07 09:47
1.29 kB09-04-07 09:47
3.52 kB09-04-07 09:47
4.14 kB09-04-07 09:47
5.06 kB09-04-07 09:47
5.31 kB09-04-07 09:47
5.16 kB09-04-07 09:47
5.21 kB09-04-07 09:47
2.39 kB09-04-07 09:47
41.79 kB09-04-07 09:47
81.42 kB14-01-08 09:20
4.79 kB09-04-07 09:47
4.72 kB09-04-07 09:47
2.53 kB09-04-07 09:47
1.38 kB09-04-07 09:47
2.60 kB09-04-07 09:47
68.09 kB09-04-07 09:47
3.68 kB09-04-07 09:47
6.09 kB09-04-07 09:47
&_03&0.00 B13-01-08 11:33
&_05&0.00 B13-01-08 11:33
&_03&0.00 B13-01-08 11:33
&_05&0.00 B13-01-08 11:33
&in&0.00 B13-01-08 11:33
&out&0.00 B13-01-08 11:33
&beans&0.00 B13-01-08 11:33
&debug&0.00 B13-01-08 11:33
&demo&0.00 B13-01-08 11:32
&events&0.00 B13-01-08 11:33
&net&0.00 B13-01-08 11:33
&packets&0.00 B13-01-08 11:33
&robot&0.00 B13-01-08 11:33
&lumaqq&0.00 B13-01-08 11:33
Sponsored links
评价成功,多谢!
CodeForge积分(原CF币)全新升级,功能更强大,使用更便捷,不仅可以用来下载海量源代码马上还可兑换精美小礼品了
您的积分不足
支付宝优惠套餐快速获取 30 积分
10积分 / ¥100
30积分 / ¥200原价 ¥300 元
100积分 / ¥500原价 ¥1000 元
订单支付完成后,积分将自动加入到您的账号。以下是优惠期的人民币价格,优惠期过后将恢复美元价格。
支付宝支付宝付款
微信钱包微信付款
更多付款方式:、
您本次下载所消耗的积分将转交上传作者。
同一源码,30天内重复下载,只扣除一次积分。
鲁ICP备号-3 runtime:Elapsed:115.384ms
登录 CodeForge
还没有CodeForge账号?
Switch to the English version?
^_^"呃 ...
Sorry!这位大神很神秘,未开通博客呢,请浏览一下其他的吧Your current location:&&&&&&&&&&&&
What measures are taken when verifying the reimbursement of expenses regarding the services for basic family planning?
11.22.2007
1. In order to facilitate the applicants, the district/county Population
Committee or town/village government shall notify the applicants of the handling
procedures and times. Normally, the reimbursement is completed within 2 weeks
from the acceptance date, and should not exceed 30 working days.
2. The service institutions shall bear any expenditure incurred by their
violations of rules related to service coverage, medical routines and charge
standards.
3. The service institutions shall not charge for the actual free-of-charge
Intrauterine Device (IUD) provid and the service
institution shall refund those charges to the patient. The service institution
may charge the IUD above the government free-of-charge standard and the incurred
expense difference shall be at the cost price for the patient.
4. The family planning operation expenses included in gynecologic surgery
shall be reimbursed at the normal rates. The expenses for the diagnosis and
treatment of gynecologic disease before a family planning operation are not free
of charge.
5. The expenses incurred by those resulting symptoms of a family planning
operation shall be verified and judged based on the Common Rules of Family
Planning Technologies, and the service institution(s) shall bear any expenses
incurred by these resulting symptoms due to their improper diagnosis and
treatment. If the resulting symptoms are serious, it shall be under verification
by a family planning expert team at a municipal or a district level. The
suspected family planning operation accident shall be forwarded to the Medical
Accident Appraisal Committee at the same level for an appraisal, and be handled
accordingly to the appraisal output.
6. If a registered permanent resident of Shanghai receives technical services
for family planning during the period that he/she works or stays in other
provinces or municipalities, the incurred expenses shall be reimbursed in
compliance with the standards of free-of-charge basic matters in Shanghai. If
the local charge standard is lower than that of Shanghai, he/she shall get the
actual if the local charge standard is higher than that of
Shanghai, he/she shall get the part of the expense within the charge standard of
Shanghai reimbursed.
7. The free-of-charge standard in Shanghai does not cover the expenses of
local examinations for a contraceptive ring or pregnancy to any married woman at
child-bearing age, who stays in Shanghai but has her registered Permanent
Residence elsewhere, at the request of the government where her Permanent
Residence is registered.
8. Anyone who is a registered permanent resident elsewhere and has married
someone who is a registered permanent resident of Shanghai shall provide the
household register of his/her spouse in the case of applying for expense
reimbursement.
9. The reimbursement verification administration may provide a
case-acceptance letter to the applicant, and keep duplicate copies of any
evidential documents provided.family&basic-搜狐博客
family&basic
请稍候,正在下载...
提示:您需要开启Javascript
检测到您使用的浏览器不支持脚本语言(javascript),或该功能已被禁用。
提供了一套非常强大的用户界面,可以让您很方便地制作出属于自己的个性主页。
如果您想体验这些新功能,需要开启浏览器的脚本(javascript)功能,然后。