2009年1月1日

Using Windows Live Writer

原文摘自:http://blog.csdn.net/thebesghost/archive/2006/09/07/1192331.aspx

1。在后端 选项->配置里,选择“允许Web Service”,然后保存
2。运行Writer之后,
在Weblog Homepage URL里输入:

http://blogs.impx.net/dangerousgin

然后是你的账号名以及密码
3。按Next之后,在上面的Type of weblog that you are using下拉框里选择

Metaweblog API

在Remote posting URL for your weblog里输入(这地址是groups.msn.com/windowslivewriter上获知的):

http://blogs.impx.net/dangerousgin/services/metablogapi.aspx

按Next。。。。

testing…

succeed。。。

posted @ 2009-01-01 20:12 Gin 阅读(436) | 评论 (1)编辑 收藏

2008年8月1日

很久没来了,一切都没变,呵呵。

posted @ 2008-08-01 17:31 Gin 阅读(375) | 评论 (1)编辑 收藏

2008年1月7日

iframe 恶意病毒解决办法
http://ppkosd.javaeye.com/blog/130612
1.服务器安全性比较差,容易攻入,把服务器上的所有网站,一一修改。 这是服务商的原因。
2.本身咱们的程序有漏洞,一般咱们的网站上都有 上传图片的程序如UPFILE.ASP,UPLOAD.ASP无组件上传,此类程序一般都有漏洞,他们利用此漏洞,先上传小木马,然后再上传大马,有:ASP站长助手或直接上传海洋木马。    上传了 ASP站长助手后,就可以在线编辑网页源码,可以直接插入代码。 因ARP欺骗网站源文件被注入了iframe代码

http://www.cnbruce.com/blog/showlog.asp?log_id=1191
简单的说,就是如果你的局域网中的一台机器被感染上病毒(例如通过一个IE的安全漏洞等等),病毒程序可以以这台机器(A),在局域网内部发起ARP cache poison的攻击,来把这台机器作为中间人插入到其它的机器(假设为B)和网关中。(典型的man-in-the-middle攻击)。然后,机器B的所有的http网络访问,都可以被A截获并插入IFRAME信息,以试图感染机器B。在这里,攻击者试图通过iframe让IE访问一个恶意站点。这个站点往往会利用微软最近的安全漏洞,如ANI安全漏洞等等。如果B的系统没有及时安装最新的安全补丁的话,就会被感染。 当A发现攻击无效,或A上的病毒被删除了的话,在机器B上你看到的这些奇怪的现象就会消失了。 如果存有网络活动记录,查看网络中的ARP的数据包,就可以确定是从那台机器发起的攻击。 IFRAME病毒防范与查杀

http://blog.qhdcs.com/u/keble/archives/2007/200766113357.html
当你打开网页发现里面全部包括下面的代码: iframe src="http://www.****.com/wd/0602.htm" width="50" height="0" /iframe 或者其他的访问带毒网站的IFRAME代码时有以下几中可能: 1、你的电脑感染了浏览器劫持方面的病毒,使用306安全卫士软件清查一遍 2、你访问的网站被黑 如果不是上面两种原因,也就是你的电脑本身没有问题的话,那么就是你所在的网络内部受到了ARP攻击,ARP攻击是由于网络中的主机冒充网关在数据中添加病毒代码所造成的,本人所租用的虚拟主机就遭受过ARP攻击,造成访问我的网站里面被添加了ifram代码。而我的页面里本身并没有此代码。

posted @ 2008-01-07 12:49 Gin 阅读(359) | 评论 (0)编辑 收藏

2007年9月22日

@echo off
rem eth //eth 为网卡名称,可在网络连接中查询,如"本地链接"
set eth="VMware Network Adapter VMnet8"
rem ip //ip 为你想更改的IP
set ip=192.168.144.1
rem gw //gw 为网关地址
set gw=none
rem netmasks //netmasks 为子网掩码
set netmasks=255.255.255.0

echo 正在将%eth%的IP更改到: %ip%
rem
if %gw%==none netsh interface ip set address %eth% static %ip% %netmasks% %gw% > nul
if not %gw%==none netsh interface ip set address %eth% static %ip% %netmasks% %gw% 1 > nul
echo.........................
echo 检查当前本机IP:
ipconfig /all
echo.........................
echo 成功将%eth%的IP更改为%ip%!
pause
close

posted @ 2007-09-22 22:38 Gin 阅读(592) | 评论 (1)编辑 收藏

2007年7月10日

“假如生活欺骗了你”
(1825年)

假如生活欺骗了你,
不要忧郁,也不要愤慨!
不顺心时暂且克制自己,
相信吧,快乐之日就会到来。

我们的心儿憧憬着未来,
现今总是令人悲哀:
一切都是暂时的,转瞬既逝,
而那逝去的将变为可爱。


致凯恩
(1825年)

我记得那美妙的一瞬:
在我的面前出现了你,
有如昙花一现的幻想,
有如纯洁之美的天仙。

在那无望的忧愁的折磨中,
在那喧闹的浮华生活的困扰中,
我的耳边长久地响着你温柔的声音,
我还在睡梦中见到你可爱的倩影。

许多年过去了,暴风骤雨般的微笑
驱散了往日的梦想,
于是我忘却了你温柔的声音,
还有你那天仙似的的倩影。

在穷乡僻壤,在囚禁的阴暗生活中,
我的日子就那样静静地消逝,
没有倾心的人,没有诗的灵感,
没有眼泪,没有生命,也没有爱情。

如今心灵以开始苏醒:
这时在我面前又重新出现了你,
有如昙花一现的幻影,
有如纯洁之美的天仙。

我的心在狂喜中跳跃,
心中的一切又重新苏醒,
有了倾心的人,有了诗的灵感,
有了生命,有了眼泪,也有了爱情。


  《致凯恩》写于1825年,凯恩(1800-1879):普希金在彼得堡和她相识,后来他幽禁在米海洛夫村时,凯恩又来到该村附近的三山村作客,和普希金时常来往,凯恩离开时,普希金将这首诗送给她。译者:戈宝权

posted @ 2007-07-10 23:48 Gin 阅读(339) | 评论 (0)编辑 收藏

2007年6月24日

--【for Grace】--

0.勇敢、乐观的面对一切!成功或者失败都是一种有意义的体验。

1.只要你愿意,永远都不算迟!如果放弃的话,那只会留下遗憾和后悔。

2.“聪明的喝咖啡”。

3.学习贵在坚持不懈。

4.过去只是历史,我们要把握现在,计划将来。

5.学习是一个积累的过程,不可能一蹴而就!

 

 

posted @ 2007-06-24 18:09 Gin 阅读(393) | 评论 (0)编辑 收藏

2007年6月1日

Sobolsoft.Automatic.File.Backup.v7.0.Incl.Keygen-Lz0
软件简介:Sobolsoft 发布的文件自动备份工具。
发布说明:包含注册机。

Super.Flexible.File.Synchronizer.Pro.v3.45.604.Keymaker.Only-CORE
软件简介:同步文件备份工具。用于在不同位置PC、笔记本电脑和服务器之间备份数据或同步文件支持定时自动备份。可同步文件、支持多配置文件、检测删除的文件、支持计划运行、可用邮件通知、支持完全镜像模式备份、可安全备份数据库文件、支持备份一个文件的多个版本、支持日志、支持备份超过4GB的文件。
发布说明:只有注册机。

NORTON.SAVE.AND.RESTORE.V2.0-CALiMERO
保护您所关系的内容。借助全新的诺顿储存还原大师,您可以自动备份和恢复计算机上的所以内容。您不仅可以活动赛门铁克获奖的Norton Ghost 软件全方位的防护,而且可以采用更快速的全新方式保存珍贵的家庭纪念品和其它重要文件。提供下载的版本为15天免费试用版。运行需要Microsoft .NET Framwwork。
主要功能:
•提供赛门铁克 Norton Ghost™ 技术的所有强大功能,同时采用更快速的方式来备份文件。
•只需一个简单的步骤即可备份计算机上的所有内容,包括数字照片、家庭视频、主要财务记录、重要计算机系统文件及其他数据。
•即使无法重新启动操作系统,也可恢复系统和数据。
•采用增量备份以最大限度利用空间,同时节省时间。
•无需重新启动系统即可进行自由备份。
•几乎可备份至所有介质,包括 CDR/RW 和 DVD+-R/RW 驱动器、USB 和 FireWire® (IEEE 1394) 外部存储设备以及 Iomega® Zip® 和 Jaz® 驱动器。

Novosoft.Handy.Backup.v5.6.0.1.Multilingual.Win2kXP2k3Vista-EuViN
Handy Backup是一款易于使得用强大备份软件,可以实现自动备份关键的数据。可以方便的备份数据到 DVD±R/RW, CD, Blu-ray, HD-DVD, 远程 FTP 服务器, 本地局域网络和硬盘或者 USB 驱动器.支持Win2kXP2k3Vista的多语言版本。

AutoSaver.v1.0-DVT
AutoSaver是一款自动备份软件,可以避免系统意外错误对用户工作造成的损失。

RS.Remote.Backup.Magic.Pro.v2.7.Cracked-PirateK
Remote Backup Magic Pro是Rebrand Software出品的一款系统恢复软件。它可以将备份镜像储存在文件夹,本地网络,FTP服务器等多种储存目标上,可以设置定期自动备份,支持文件加密等。

WinBackup.Professional.v2.3.0.WinAll.Cracked-CRD
WinBackup Professional 是一个非常强大而且易于使用的数据备份软件。系统采用了全新人性化的界面设计,使操作更加简单;支持128 or 256-bit加密技术,全面保护你的重要数据;支持直接备份数据到硬盘、USB存储设备、CDR、CD-RW、DVD-R、DVD-RW、移动磁盘等;支持定时自动备份功能;兼容任何操作系统,采用了多线程技术设计以求达到最高的执行效率。快速的备份引擎和压缩引擎,加上安全的加密技术, WinBackup为你的数据提供全面的安全保障。WinBackup 提供了方便的树状选单,让您快速选取所要备份的文件或目录,还有计划任务备份的功能

PowerArchiver.2007.v10.00.42.Regged-EXPLOSiON
曾获奖的 Windows 文件压缩存档工具,支持大部分压缩和编码文件(即压缩后自解压的可执行文件),它通过一个与Windows Explorer无缝整合的易用界面提供了许多强大的功能和工具。它是真正全球化的存档软件,支持6种语言。主要亮点:超级zip支持-快速强劲压缩制作无限大小的zip文件,胜过winzip;无敌的安全性-有5种加密算法;7-Zip压缩-比其它任何压缩工具有更高的压缩比;自动备份功能;多种格式支持-支持ZIP, 7-Zip, CAB, TAR, GZIP, BZIP2, RAR, ACE及更多格式;品质保证的兼容性:通过微软“Designed for Windows”和“Optimized for Windows XP”认证。

posted @ 2007-06-01 09:33 Gin 阅读(656) | 评论 (0)编辑 收藏

2007年5月27日

使用FCKeditor修改已发表文章(已有数据)出错。
最早是这样写的:
<!--#include file="FCKeditor/fckeditor.asp" -->
<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = "/FCKeditor/"
oFCKeditor.Value = replace(modRs("memo"),"''","'")
oFCKeditor.Create "memo" 
%>

有时会出错。

接着这样写:
<!--#include file="FCKeditor/fckeditor.asp" -->
<textarea name="memo" style="display:none"><%=modRs("memo")%></textarea>
<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = "/FCKeditor/"
oFCKeditor.Value = replace(modRs("memo"),"''","'")
oFCKeditor.Create "memo" 
%>

基本没问题,但修改完会多出一个逗号。

最终是这样写:
<script type="text/javascript" src="FCKeditor/fckeditor.js"></script>
<textarea name="memo" style="display:none"><%=modRs("memo")%></textarea>
<script type="text/javascript">
<!--调出编辑器的主程序
var sBasePath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf('edit.asp')) ;
var oFCKeditor = new FCKeditor('memo') ;
//alert(sBasePath);
oFCKeditor.BasePath  = sBasePath + 'FCKeditor/';
//oFCKeditor.ToolbarSet = 'Default';
oFCKeditor.ReplaceTextarea();
//-->
</script>
暂时没发现错误。

posted @ 2007-05-27 15:48 Gin 阅读(773) | 评论 (0)编辑 收藏

2007年5月12日

TortoiseSVN
A Subversion client for Windows
Version 1.4.1
Stefan Küng
Lübbe Onken
Simon Large
2006/10/13 22:32:24 (r7765)

3.2. Svnserve Based Server
3.2.1. Introduction
There may be situations where it's not possible to use Apache as your server. Fortunately, Subversion includes Svnserve - a lightweight stand-alone server which uses a custom protocol over an ordinary TCP/IP connection.

In most cases svnserve is easier to setup and runs faster than the Apache based server.

3.2.2. Installing svnserve

Get the latest version of Subversion from http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91 .

If you already have a version of Subversion installed, and svnserve is running, you will need to stop it before continuing.

Run the Subversion installer. If you run the installer on your server you can skip step 4.

Open the windows-explorer, go to the installation directory of Subversion (usually C:\Program Files\Subversion) and in the bin directory, find the files svnserve.exe, libdb44.dll, libeay32.dll and ssleay32.dll - copy these files into a directory on your server e.g. c:\svnserve


3.2.3. Running svnserve
Now that svnserve is installed, you need it running on your server. The simplest approach is to run the following from a DOS shell or create a windows shortcut:

svnserve.exe --daemon

svnserve will now start waiting for incoming requests on port 3690. The --daemon switch tells svnserve to run as a daemon process, so it will always exist until it is manually terminated.

If you have not yet created a repository, follow the instructions given with the Apache server setup Section 3.1.4, “Configuration”.

To test that svnserve is working, use TortoiseSVN → Repo-Browser to view a repository.

Assuming your repository is located in c:\repos\TestRepo, and your server is called localhost, enter:

svn://localhost/repos/TestRepo

when prompted by the repo browser.

You can also increase security and save time entering Url's with svnserve by using the --root switch to set the root location and restrict access to a specified directory on the server:

svnserve.exe --daemon --root drive:\path\to\repository

Using the previous test as a guide, svnserve would now run as:

svnserve.exe --daemon --root c:\repos

And in TortoiseSVN our repo-browser Url is now shortened to:

svn://localhost/TestRepo

Note that the --root switch is also needed if your repository is located on a different partition or drive than the location of svnserve on your server.

 Warning
Do not create or access a Berkeley DB repository on a network share. It cannot exist on a remote filesystem. Not even if you have the network drive mapped to a drive letter. If you attempt to use Berkeley DB on a network share, the results are unpredictable - you may see mysterious errors right away, or it may be months before you discover that your repository database is subtly corrupted.
 

3.2.3.1. Run svnserve as a Service
If you are concerned about always having a user logged in on your server, or worried about someone shutting down svnserve or forgetting to restart it after a reboot, it is possible to run svnserve as a windows service. Starting with Subversion 1.4, svnserve can be installed as a native windows service, in previous versions it can be installed using a wrapper.

To install svnserve as a native windows service, execute the following command all on one line to create a service which is automatically started when windows starts.

sc create svnserve binpath= "c:\svnserve\svnserve.exe --service
 --root c:\repos" displayname= "Subversion" depend= tcpip start= auto


 Tip
Microsoft now recommend services to be run as under either the Local Service or Network Service account. Refer to The Services and Service Accounts Security Planning Guide . To create the service under the Local Service account, append the following to the example above.

obj= "NT AUTHORITY\LocalService"

Note that you would have to give the Local Service account appropriate rights to both Subversion and your repositories, as well as any applications which are used by hook scripts.
 

To install svnserve using a wrapper, one written specifically for svnserve is SvnService. Magnus Norddahl adapted some skeleton code from Microsoft, and further improvements have been made by Daniel Thompson. Daniel's version is available for download from tigris.org .

More generic tools like firedaemon will also work. Note that you will still need to run svnserve with the --daemon switch.

Finally, if you have access to the Windows 2000/XP/2003 resource kit you can use SrvAny from Microsoft. This is the official Microsoft way of running programs as services, but it is a bit messy (requires registry editing) and if you stop the service it will kill svnserve immediately without letting it clean up. If you don't want to install the entire reskit, you can download just the SrvAny components from Daniel Petri .

3.2.4. Authentication with svnserve
The default svnserve setup provides anonymous read-only access. This means that you can use an svn:// Url to checkout and update, or use the repo-browser in TortoiseSVN to view the repository, but you won't be able to commit any changes.

To enable write access to a repository, you need to edit the conf/svnserve.conf file in your repository directory. This file controls the configuration of the svnserve daemon, and also contains useful documentation.

You can enable anonymous write access by simply setting:

[general]
anon-access = write

However, you will not know who has made changes to a repository, as the svn:author property will be empty. You will also be unable to control who makes changes to a repository. This is a somewhat risky setup!

One way to overcome this is to create a password database:

[general]
anon-access = none
auth-access = write
password-db = userfile

Where userfile is a file which exists in the same directory as svnserve.conf. This file can live elsewhere in your filesytem (useful for when you have multiple repositories which require the same access rights) and may be referenced using an absolute path, or a path relative to the conf directory. If you include a path, it must be written /the/unix/way. Using \ or drive letters will not work. The userfile should have a structure of:

[users]
username = password
...

This example would deny all access for unauthenticated (anonymous) users, and give read-write access to users listed in userfile.

 Tip
If you maintain multiple repositories using the same password database, the use of an authentication realm will make life easier for users, as TortoiseSVN can cache your credentials so that you only have to enter them once. More information can be found in the Subversion book, specifically in the sections Create a 'users' file and realm and Client Credentials Caching
 

3.2.5. Authentication with svn+ssh
Another way to authenticate users with a svnserve based server is to use a secure shell (SSH) to tunnel requests through.

With this approach, svnserve is not run as a daemon process, rather, the secure shell starts svnserve for you, running it as the SSH authenticated user. To enable this, you need a secure shell daemon on your server.

It is beyond the scope of this documentation to detail the installation and setup of a secure shell, however you can find further information in the TortoiseSVN FAQ . Search for “SSH”.

Further information about svnserve can be found in the SVN book .

3.2.6. Path-based Authorization with svnserve
Starting with Subversion 1.3, svnserve supports the same mod_authz_svn path-based authorization scheme that is available with the Apache server. You need to edit the conf/svnserve.conf file in your repository directory and add a line referring to your authorization file.

[general]
authz-db = authz

Here, authz is a file you create to define the access permissions. You can use a separate file for each repository, or you can use the same file for several repositories. Read Section 3.1.6, “Path-Based Authorization” for a description of the file format.

 

posted @ 2007-05-12 23:59 Gin 阅读(2068) | 评论 (1)编辑 收藏

2007年4月11日

去年的今天报到的
不知不觉
一周年了

呵呵。

posted @ 2007-04-11 10:41 Gin 阅读(1237) | 评论 (2)编辑 收藏

2007年4月10日

 深入浅出浮点数
http://stephensuen.spaces.live.com/Blog/cns!1p1G_DGhjYiYGmj6keNZQAcw!172.entry
“浮点数(Floating Point Number)计算机系统中用于表达实数或者说小数的一种方式。由于其表达方式的原因,产生了围绕浮点数的许多常见问题。最典型的就是"为什么我的浮点运算的结果和想象的不同",即浮点数精度损失问题。本文将回避关于浮点数枯燥的数值计算理论,基于 Java 平台的浮点数支持(当然,也适用于其它绝大部分编程语言),尽可能深入浅出的介绍浮点数的基本知识,和常见问题产生的原因。……”

浮点数表示及其实现.
http://blog.csdn.net/biblereader/archive/2006/06/21/819428.aspx
“我两年前就知道不应该用==号来判断浮点数的相等了,因为存在一个精度的问题,但是一直以来,都没怎么在乎这些东西,而实际上,我对于浮点数的结构,虽然了解,但并不清晰. 作为一个C++爱好者,应该尽量搞清楚每一个问题,所以我搞清楚了浮点数的内在表示及实现.在没有大问题的情况下,一切以易于理解和记忆为标准.……”

浮点数精度的奇怪问题
http://topic.csdn.net/t/20060215/17/4557755.html
“近日在看How   Not   to   Program   in   C++,其中的Program   40提到了一个浮点数精度检查程序:  
  This   program   is   designed   to   figure   the   accuracy   of   the   floating-point   numbers.   The   idea   is   simple.   Compute   the   following   until   the   numbers   are   equal:  
   
                  1.0   ==   1.5             (1   +   1/2       or   1   +   1/21)         (1.1           binary)  
                  1.0   ==   1.25           (1   +   1/4       or   1   +   1/22)         (l.oi         binary)  
                  1.0   ==   1.125         (1   +   1/8       or   1   +   1/23)         (1.001       binary)  
                  1.0   ==   1.0625       (1   +   1/16     or   1   +   1/24)         (1.0001     binary)  
                  1.0   ==   1.03125     (1   +   1/32     or   1   +   1/25)         (1.00001   binary)  
   
  That   will   give   us   the   number   of   digits   of   accuracy.     
  This   program   was   run   on   a   PC-class   machine   with   32-bit   floating-point.   So   how   many   binary   digits   would   you   expect   in   a   32-bit   float   format?   
  This   program   does   not   give   the   right   answer.   Why?……”  

关于VB中整除运算的问题
专家解答: 四舍五入没有问题,跟VB也没有关系,只是浮点型数据存储的精度问题,请参阅VB帮助。避免的方法很简单,将0.5改为0.499999即可。另外要禁止对浮点数作相等比较。

 

IEEE754浮点数格式
http://bbs.21ic.com/club/bbs/list.asp?boardid=11&t=2158403

一:概述
IEEE754浮点数格式
短实数也称单精度数      符号位1位,阶码8位,尾数23位
长实数也称双精度数      符号位1位,阶码11位,尾数52位

42E48000

第一步,化为2进制
0100 0010 1110 0100 1000 0000 0000 0000
第二步:因为IEEE754使用1个符号,8个阶码,23个尾数,我们分别在上面提取这些内容.
符号:第一位:0 表示正数
阶码:2-9位:10000101  为133,实际的幂值为133-127=6
尾数:10-32位:11001001000000000000000,实际值为1.11001001 (1+尾数)
第三步:根据公式写出实际数值大小
为1110010.01,化为十进制为:114.25

二:基础知识扩展
-----------------------------------------------------------------------
值     存储为                     指数偏移量
real*4   1位符号位(s)、8位指数(e),23位尾数(m,共32位)  127(7FH)
real*8   1位符号位(s)、11位指数(e),52位尾数(m,共64位) 1023(3FFH)
real*10  1位符号位(s)、15位指数(e),64位尾数(m,共80位) 16383(3FFFH)
-----------------------------------------------------------------------

计算公式:
V=(-1)^s*2^E*M

V=(-1)^s * 2^(     1    -指数偏移量) * (  尾数)       (当指数位为0时)
V=(-1)^s * 2^(指数位数值-指数偏移量) * (1+尾数)       (当指数位不全为0或不全1)

情况1:当e(各位)为全'0'时:
E=1-(2^(e(位数)-1)-1);<===>E=1-指数偏移量
M=m。

如:real*4是8位,E=1-(2^(8-1)-1)=1-127=-126
在real*4时:
V=(-1)^s*2^(-126)*m
在real*8时:
V=(-1)^s*2^(-1022)*m


情况2:当e(各位)不为全'0'且不为全'1'时:
E=e(值)-(2^(e(位数)-1)-1);<===>E=指数位数值-指数偏移量
M=1+m。

在real*4时:
V=(-1)^s*2^(e(值)-127)*(1+m)
在real*8时:
V=(-1)^s*2^(e(值)-1023)*(1+m)

三:将浮点格式转换成十进制数
[例3.1]:
0x00280000(real*4)
转换成二进制
00000000001010000000000000000000
我们将其分段:
符号位 指数部分(8位) 尾数部分
0      00000000        01010000000000000000000
符号位=0;
指数部分=0;
尾数部分M为m:
0.01010000000000000000000=0.3125
该浮点数的十进制为:
(-1)^0*2^(-126)*0.3125
=3.6734198463196484624023016788195e-39

[例3.2]:
0xC04E000000000000(real*8)
转换成二进制
110000000100111 _
0000000000000000000000000000000000000000000000000
符号位 指数部分(11位)
尾数部分
1      10000000100      
1110000000000000000000000000000000000000000000000000
符号位=1;指数=1028,因指数部分不为全'0'且不为全'1',
则:尾数部分M为1+m:
1.1110000000000000000000000000000000000000000000000000=1.875
该浮点数的十进制为:
(-1)^1*2^(1028-1023)*1.875
=-60


四:将十进制数转换成浮点格式(real*4)

[例4.1]:
26.0
十进制26.0转换成二进制
11010.0
规格化二进制数
1.10100*2^4
计算指数
4+127=131
符号位 指数部分 尾数部分
0 10000011 10100000000000000000000
以单精度(real*4)浮点格式存储该数
0100 0001 1101 0000 0000 0000 0000 0000
0x41D0 0000

[例4.2]:
0.75
十进制0.75转换成二进制
0.11
规格化二进制数
1.1*2^-1
计算指数
-1+127=126
符号位 指数部分 尾数部分
0 01111110 10000000000000000000000
以单精度(real*4)浮点格式存储该数
0011 1111 0100 0000 0000 0000 0000 0000
0x3F40 0000

[例4.3]:
-2.5
十进制-2.5转换成二进制
-10.1
规格化二进制数
-1.01*2^1
计算指数
1+127=128
符号位 指数部分 尾数部分
1 10000000 01000000000000000000000
以单精度(real*4)浮点格式存储该数
1100 0000 0010 0000 0000 0000 0000 0000
0xC020 0000

posted @ 2007-04-10 00:16 Gin 阅读(580) | 评论 (0)编辑 收藏

2007年4月9日

基于大数的本原根判断算法
原文见:http://c05.blog.hexun.com/4014989_d.html

一.本原根的定义:

如果a的阶m等于φ(n),则称an的本原根(生成元)。如果an的本原根,则

a, a2, , aφ(n)mod n下互不相同且都与n互素。

特别地,如果a是素数p的本原根,则

a, a2, , ap-1 mod p下都不相同。

二.使用c++语言描述如下:

bool  is_prime(HugeInt num)//判断是否为素数

{

      bool   prime=true;

      for(HugeInt i=2;i<=num/2;i++)

      {

          if(num%i=="0")

                     {  prime=false;

             break;

          }

      }

    return   prime;

}

bool IsBuild(HugeInt a,HugeInt n)// a是否为n的本原根

{      HugeInt h=a;

         HugeInt tempa=a;

       bool f=true;

       HugeInt count=1;

        HugeInt equ;

       while(f&&count<N)<N)< font="" />

       {

                   HugeInt temp=h%n;

               if(temp==1)

                   {  if(!is_prime(n))

                            {return true;}

                      f=false;

                     break;

                   }

                   else

                   { 

                      if(temp!=equ&&temp%n!="0")

                      {equ=temp;

                       h*=tempa;

                       count++;

         }

                     else

                      {f=false;

                       break;

                      }

    

                   }

     }

    if(count==(n-1))

     {return true;}

  return false;

}


Diffie-Hellman 密钥交换算法中大素数 p 及其本原根 g 的求法
原文见:http://www.coolcode.cn/andot/php/how-to-compute-p-g-of-diffie-hellman-arithmetic/96?m=20051223

求一个大素数 p 很容易,用现成的素性验证算法就可以了。不过已知一个素数 p,求其本原根则很困难,因为需要将 p - 1 的素因子 q1,q2,……qk-1,qk都找出来,然后分别验证 gq1 mod p, gq2 mod p, ……gqk-1 mod p, gqk mod p,如果都不等于 1,则 g 是 p 的一个本原根。而然,如果 p 是一个很大的素数,例如 128 个 2 进制位的素数,要分解出 p - 1 的所有素因子来则是一件很困难的事情。

难道没有办法快速求一个大素数 p 及其本原根 g 的方法吗?方法肯定是有的,不然 Diffie-Hellman 算法也就没有意义了。下面就给出一个快速求大素数 p 及其本原根的算法,并给出相应的 php 的程序。

算法如下:

P1. 利用素性验证算法,生成一个大素数 q;
P2. 令 p = q * 2 + 1;
P3. 利用素性验证算法,验证 p 是否是素数,如果 p 是合数,则跳转到 P1;
P4. 生成一个随机数 g,1 < g < p - 1;
P5. 验证 g2 mod p 和 gq mod p 都不等于 1,否则跳转到 P4;
P6. g 是大素数 p 的本原根。

生成一个 128 位的素数 p 和它的一个小于 128 位的本原根 g 的程序如下(需要 big_int 扩展):

下载: getdhpg.php
  1. <?php
  2.     $f = false;
  3.     $n1 = bi_from_str("1");
  4.     $n2 = bi_from_str("2");
  5.     while (!$f) {
  6.         // P1.  利用素性验证算法,生成一个大素数 q;
  7.         $q = bi_next_prime(bi_set_bit(bi_rand(127), 126));
  8.         // P2.  令 p = q * 2 + 1;
  9.         $p = bi_set_bit(bi_lshift($q, 1), 0);
  10.         // P3.  利用素性验证算法,验证 p 是否是素数,如果 p 是合数,则跳转到 P1;
  11.         if (bi_is_prime($p)) $f = true;
  12.     }
  13.     while ($f) {
  14.         // P4.  生成一个随机数 g,1 < g < p - 1;
  15.         $g = bi_rand(127);
  16.         // P5.  验证 g^2 mod p 和 g^q mod p 都不等于 1,否则跳转到 P4;
  17.         if ((bi_powmod($g, $n2, $p) <> $n1) and
  18.             (bi_powmod($g, $q, $p) <> $n1)) {
  19.             $f = false;
  20.         }
  21.     }
  22.     // P6.  g 是大素数 p 的本原根。
  23.     echo bi_to_str($p)."\n";
  24.     echo bi_to_str($g)."\n";
  25. ?>


 

posted @ 2007-04-09 08:34 Gin 阅读(887) | 评论 (0)编辑 收藏

2007年4月2日

原文:http://xmfish.com/thread-677086-1-1.html

现在理财的话题是越来越热了,我也来分享一点我的理财经验吧——不一定适合每个人,大家就算作个参考吧。也希望能抛砖引玉,请各路高手多多指点。

先说说保险吧。

我和LP都在公司工作,收入尚可,除了社保之外公司还提供了一些补充的医疗和意外保险。所以我们现在在保险方面额外的投入不多,只买了一点大病保险。至于全面的保障,我有自己的想法。

虽然我们现在都还年轻,但是已经不得不为将来的银发生活作出规划了。现在很多保险公司都有各种各样的养老保险或者投资性质的养老保险,我却没有选择它们。为什么呢?

其实无论各种保险公司如何包装、宣传他们的养老保险和投资保险产品,从本质上讲,你交给保险公司的钱总是被分成了三部分:一部分钱用来买了你的保障(比如意外身故保险金);第二部分钱是保险公司的“手续费/劳务费/辛苦费”;省下的第三部分钱才被用来投资、增值,作为数十年之后你的养老金。

前面说了,我和LP现在的公司都提供了比较完善的保险保障,所以我不太需要在这方面投入更多了。就算我们想要为自己购买更多的保障,我也是倾向于购买比较单纯的保障性保险,而不是所谓的“投资型”保险。这个就是我说的“巧买保险”。

如果去掉了“保障”的部分,这些养老保险、投资保险所宣传的投资功能又如何呢?我的意见是,不如自己拿来投资。首先,免去了保险公司的“劳务费”,这个本身就是一笔收益。

其次,国内寿险公司的投资渠道受到比较严格的限制,只能用来投资储蓄、国债、央行票据、低风险的基金等等。这些东西咱们自己也可以直接投资,不一定非要“麻烦”保险公司。

说到了“储蓄”,大家都觉得现在利率很低,还要扣利息税,再加上通货膨胀率,有人甚至说现在实际上已经是“负利率”了。但是,关键的一点是,如果要想保证本金的绝对安全,并获取一定的收益(虽然不高),储蓄几乎是唯一的选择(另外的选择还有国债,其实和储蓄也差不多,后面我再说)。

那么作为普通的工薪族,我们应该如何储蓄呢?大家都知道定期储蓄比活期储蓄利息高,越长的定期利率越高。但是长期的定期存款要是临时需要用钱的时候又不太方便——提前支取的话就变成活期了。我的办法是“循环定期存款”——每个月从收入中拿出固定的一笔钱,存5年定期(现在最长的定期),并且设置为“自动转存”,转存也是5年。这样坚持下来,满5年之后,你在每个月都会有一笔定期存款到期。如果需要就可以取出来,如果不需要的话就会自动转存了——这样既保证了资金存取的相对灵活,又可以获取最高的存款利息。就算你现在是刚刚参加工作的年轻人,每个月只能拿出一点点钱来储蓄,长期坚持,积少成多,最后的收益也是相当可观的。

举个简单的例子,如果每个月存300元,都是1年定期(税后收益1.8%),坚持15年的话,得到的收益就是7000多元。如果存5年定期,受益就是更多了。很多养老保险都会用一些数据忽悠客户,比如说:每月存款XXX元,多少年后,给付保险金XX万元。乍看之下这个“xx万元”很是诱人,其实如果你把同样的钱用循环定期存款的方式放进银行,最后拿到的钱绝对比保险给你的多。这两者之间的差额,就是前面说的保险费用里面的第一部分(保障金)和第二部分(保险公司的“辛苦费”)。

随着工作年限的增长,你的收入也会增长,每个月的存款自然也可以相应增加。设想一下,如果你工作25年,存款25年,那么当你25年之后退休的时候,就可以按月领取你自己存下的“养老金”,按部就班地领上25年!其实这个方法也不新鲜,银行早就有“零存整取”的存款方式了,但是我这种方法的利率比银行的“零存整取”利息要高的多。而且如果真的有什么临时的情况,我可以自由决定取出一部分存款,或者隔一两个月不存钱。而“零存整取”就没有这么方便了。

“循环存款”的另外一个好处就是可以抵御利率变动的风险。过去的十几年中国的储蓄利率已经降到了很低的程度,从最近的加息开始,大家普遍认为中国已经进入了新的加息周期。很多人怕麻烦,不原意每个月存钱(其实用网上银行一点都不麻烦),宁愿把一大堆钱都放在活期存折上,凑够一笔“整数”才去存定期。这样万一你存款之后不久利率再次上调,你就面临着利息收益的损失。而采用“循环存款”的方式,等于把存款的时间点分散开了,也就减少了利息可能上涨带来的风险。

前面说了国债,大家都有印象,每次发行新的国债的时候,新闻里面都会说“大批老年市民彻夜排队抢购国债”。其实买国债大可不必这么麻烦,通过网上银行,买“银行柜台销售的记帐式国债”,或者最新的“储蓄式国债”,足不出户就可以投资国债了。具体内容这里就不说了,大家去银行的网站上了解一下吧。

储蓄和国债的根本目标是保证本金的安全,并获取可以预期的固定收益。要想赚更多的钱,就要进行更高风险的投资。我以前也曾经是过投资股票,但总是运气不佳,从来没有赚过钱。后来我就看中了股票式基金。基金的绝对收益没有直接炒股票那么高,但是风险相对要小一些,而且长线投资,不用你自己每天关心行情——有基金经理替你操心呢。

作为工薪族,我手里并没有一大笔闲钱拿来投资,所以我买基金也是每月拿出固定的金额,做“定期定投”。这种方式的两个优点:一是积少成多,二是分散风险(谁有本事总能在最低点买入,最高点卖出呢?)。

说到“定期定投”,现在媒体上总是宣传,某某银行、某某基金推出了定期定投的投资方式,定期从你的帐户上扣款。其实这里面有一个误解——“定期定投”不一定非要银行和基金公司支持。如果和银行或者基金公司签订了“定期定投”协议,就和这家银行、这支基金捆绑在一起了,丧失了自己选择的灵活性。

我的“定期定投”和我的存款一样,全凭自己操作——为了自己未来的幸福生活,干嘛非要人家帮你“强制投资”呢?现在股票式基金有一大把,如何选择呢?我采用的是比较懒人的方法:看基金历史数据,选历史业绩比较好的几只基金,每个月轮流买上一些。要是想再简单一些,还可以买那种“基金宝”,相当于是基金上面的基金。

另外各种基金在费率上面也有一些细微的差别,有些基金通过基金公司或者特定银行的网站直接购买手续费有优惠。另外还有很多基金,持有期长的话赎回费率也有优惠,甚至完全没有赎回费用,这种基金就比较适合长期投资(赚养老金不就是要长期投资吗?)。还有一些基金有“前端收费”和“后端收费”两种方式,如果采用“后端收费”的方式,买基金的时候完全没有费用,以后赎回(卖出)基金的时候才收钱,如果持有期足够长,这个费用也优惠掉了。

基金的收益到底有多少呢?今年上半年股市正好由熊转牛,基金收益大好,可能不足以作为基金收益的参照。给大家一个另外的例子吧:我买基金大概是从2004年底开始的,那个时候股市大概还在1300点左右;到了2006年初的时候,股市还是1300点左右,期间还曾经跌到过900多点,在股市上赚钱的人可不多。但是那个时候我手里的股票式基金已经有超过10%的收益了。

除了定期存款和投资之外,大家通常都会在自己的账户上留下一些活期存款,再加上手里的现金,应付日常的各种花销。这里面其实也可以做出一些文章来的。

首先是活期帐户上的准备金,我会买成“货币市场基金”,“货币市场基金”人称“准活期”,现在的收益率大概比一年定期存款高一点点(1.8%到2.0%之间),赎回的话1-2天就到帐了,足以应付一般的需要。2万块钱的货币市场基金,放上一个月收益就可以有30多块,而如果存活期的话收益还不到10块钱——收益率3倍的差别可不小啊。

钱都放在银行,买了基金,平时花钱怎么办呢?最后的一招就是信用卡了。信用卡的好处就是透支消费,花银行的钱,而把自己的钱留下来去投资。现在国内各大银行都推出了各种信用卡,而且大多可以通过一定的消费(比如一年内刷满5次,或者刷够5000元,门槛很低的)免去信用卡的年费,这样对于聪明的持卡人来说,信用卡就完全是一种免费的金融工具了。

比如我每个月要花5000块钱,如果我直接把这些钱取出来,以现金方式花掉,那一分钱的收益也不会有。如果我尽量使用信用卡(能刷卡的地方都刷,能不用现金就不用),可能能省下4000块钱的现金。如果用这些现金买成货币市场基金,也能小有收益呢。

当然,用信用卡也是有窍门的。关键就是随时掌握自己的额度(记账是个好方法,我一直用EXCEL记帐,坚持7年了。从去年开始用一款软件叫做“家财通”,两个配合可以完全满足我的需要),额度要用足,但是千万不要用“爆”;每个月都要足额还款,但是绝不多还一分钱(信用卡上面的余额是完全没有利息的)。比如我5月份刷卡花了5000元,这笔钱我需要在6月25日之前还款;我在6月1日到25日之间又刷了4000块。按照我的习惯,我一般都在20日左右还款,但是都是严格按照上个月的花销还,绝不多还一分钱(当然也不要少还钱,要不然贷款利息可是大大的!)。剩下的钱多留在我自己帐户里一天,我就能多一天的收益。

信用卡的好处当然不仅是免息贷款这一点,更重要的是可以逐渐积累你个人的信用记录。随着中国整体的个人信用体系不断完善,保持良好的个人信用记录会有越来越大的好处。以后甚至信用度高的人,贷款利息都可以比别人少一些,这个就是后话了。

最后再补充一点:很多人说,工薪族没有时间和精力理财。其实我上面说的各种方式基本上都是通过网络银行完成的,根本不用去柜台排队。每个人都可以试试的。

上面就是50e作为一个工薪族的理财经验。  

========

还有个小建议,考虑到基金定投的长期(10~20年)年均收益可达5%~8%,我们可以好好利用基金定投来规划好未来的教育基金、养老基金、医疗基金,比如每月定投300作为教育基金,20年后依据复利效应可以达到13万左右(以年均5%的收益算),孩子的大学教育费就足够了。

目前货币基金的年收益可达2%~3%,无手续费,购买赎回都方便快捷,资金的流动便利性与银行活期储蓄差不多,但收益等同于1年定期了,是很好的活期储蓄替代品。象家庭或个人用于活期储蓄的钱可考虑放在货币基金市场(具体说明在我的这个帖子里http://www.xmfish.com/thread-628332-1-1.html)。

posted @ 2007-04-02 15:15 Gin 阅读(933) | 评论 (1)编辑 收藏

2007年3月25日

An Essay on Endian Order


Copyright (C) Dr. William T. Verts, April 19, 1996
http://www.cs.umass.edu/~verts/cs32/endian.html
Depending on which computing system you use, you will have to consider the byte order in which multibyte numbers are stored, particularly when you are writing those numbers to a file. The two orders are called "Little Endian" and "Big Endian".

The Basics

"Little Endian" means that the low-order byte of the number is stored in memory at the lowest address, and the high-order byte at the highest address. (The little end comes first.) For example, a 4 byte LongInt

    Byte3 Byte2 Byte1 Byte0

will be arranged in memory as follows:
    Base Address+0   Byte0
    Base Address+1   Byte1
    Base Address+2   Byte2
    Base Address+3   Byte3

Intel processors (those used in PC's) use "Little Endian" byte order.
"Big Endian" means that the high-order byte of the number is stored in memory at the lowest address, and the low-order byte at the highest address. (The big end comes first.) Our LongInt, would then be stored as:

    Base Address+0   Byte3
    Base Address+1   Byte2
    Base Address+2   Byte1
    Base Address+3   Byte0

Motorola processors (those used in Mac's) use "Big Endian" byte order.

Which is Better?

You may see a lot of discussion about the relative merits of the two formats, mostly religious arguments based on the relative merits of the PC versus the Mac. Both formats have their advantages and disadvantages.

In "Little Endian" form, assembly language instructions for picking up a 1, 2, 4, or longer byte number proceed in exactly the same way for all formats: first pick up the lowest order byte at offset 0. Also, because of the 1:1 relationship between address offset and byte number (offset 0 is byte 0), multiple precision math routines are correspondingly easy to write.

In "Big Endian" form, by having the high-order byte come first, you can always test whether the number is positive or negative by looking at the byte at offset zero. You don't have to know how long the number is, nor do you have to skip over any bytes to find the byte containing the sign information. The numbers are also stored in the order in which they are printed out, so binary to decimal routines are particularly efficient.

What does that Mean for Us?

What endian order means is that any time numbers are written to a file, you have to know how the file is supposed to be constructed. If you write out a graphics file (such as a .BMP file) on a machine with "Big Endian" integers, you must first reverse the byte order, or a "standard" program to read your file won't work.

The Windows .BMP format, since it was developed on a "Little Endian" architecture, insists on the "Little Endian" format. You must write your Save_BMP code this way, regardless of the platform you are using.

Common file formats and their endian order are as follows:

Adobe Photoshop -- Big Endian
BMP (Windows and OS/2 Bitmaps) -- Little Endian
DXF (AutoCad) -- Variable
GIF -- Little Endian
IMG (GEM Raster) -- Big Endian
JPEG -- Big Endian
FLI (Autodesk Animator) -- Little Endian
MacPaint -- Big Endian
PCX (PC Paintbrush) -- Little Endian
PostScript -- Not Applicable (text!)
POV (Persistence of Vision ray-tracer) -- Not Applicable (text!)
QTM (Quicktime Movies) -- Little Endian (on a Mac!)
Microsoft RIFF (.WAV & .AVI) -- Both
Microsoft RTF (Rich Text Format) -- Little Endian
SGI (Silicon Graphics) -- Big Endian
Sun Raster -- Big Endian
TGA (Targa) -- Little Endian
TIFF -- Both, Endian identifier encoded into file
WPG (WordPerfect Graphics Metafile) -- Big Endian (on a PC!)
XWD (X Window Dump) -- Both, Endian identifier encoded into file

Correcting for the Non-Native Order

It is pretty easy to reverse a multibyte integer if you find you need the other format. A single function can be used to switch from one to the other, in either direction. A simple and not very efficient version might look as follows:
    Function Reverse (N:LongInt) : LongInt ;
     Var B0, B1, B2, B3 : Byte ;
    Begin
        B0 := N Mod 256 ;
        N  := N Div 256 ;
        B1 := N Mod 256 ;
        N  := N Div 256 ;
        B2 := N Mod 256 ;
        N  := N Div 256 ;
        B3 := N Mod 256 ;
        Reverse := (((B0 * 256 + B1) * 256 + B2) * 256 + B3) ;
    End ;

A more efficient version that depends on the presence of hexadecimal numbers, bit masking operators AND, OR, and NOT, and shift operators SHL and SHR might look as follows:
    Function Reverse (N:LongInt) : LongInt ;
     Var B0, B1, B2, B3 : Byte ;
    Begin
        B0 := (N AND $000000FF) SHR  0 ;
        B1 := (N AND $0000FF00) SHR  8 ;
        B2 := (N AND $00FF0000) SHR 16 ;
        B3 := (N AND $FF000000) SHR 24 ;
        Reverse := (B0 SHL 24) OR (B1 SHL 16) OR (B2 SHL 8) OR (B3 SHL 0) ;
    End ;

There are certainly more efficient methods, some of which are quite machine and platform dependent. Use what works best.

posted @ 2007-03-25 12:36 Gin 阅读(1044) | 评论 (1)编辑 收藏

2007年2月1日

1. 人之所以痛苦,在于追求错误的东西。
2. 如果你不给自己烦恼,别人也永远不可能给你烦恼。因为你自己的内心,你放不下。
3. 你永远要感谢给你逆境的众生。
4. 你永远要宽恕众生,不论他有多坏,甚至他伤害过你,你一定要放下,才能得到真正的快乐。
5. 当你快乐时,你要想这快乐不是永恒的。当你痛苦时,你要想这痛苦也不是永恒的。
6. 今日的执著,会造成明日的后悔。
7. 你可以拥有爱,但不要执著,因为分离是必然的。
8. 不要浪费你的生命在你一定会后悔的地方上。
9. 你什么时候放下,什么时候就没有烦恼。
10. 每一种创伤,都是一种成熟。
11. 狂妄的人有救,自卑的人没有救,认识自己,降伏自己,改变自己,才能改变别人。
12. 你不要一直不满人家,你应该一直检讨自己才对。不满人家,是苦了你自己。
13. 一个人如果不能从内心去原谅别人,那他就永远不会心安理得。
14. 心中装满着自己的看法与想法的人,永远听不见别人的心声。
15. 毁灭人只要一句话,培植一个人却要千句话,请你多口下留情。
16. 根本不必回头去看咒骂你的人是谁?如果有一条疯狗咬你一口,难道你也要趴下去反咬他一口吗?
17. 永远不要浪费你的一分一秒,去想任何你不喜欢的人。
18. 请你用慈悲心和温和的态度,把你的不满与委屈说出来,别人就容易接受。
19. 同样的瓶子,你为什么要装毒药呢?同样的心里,你为什么要充满着烦恼呢?
20. 得不到的东西,我们会一直以为他是美好的,那是因为你对他了解太少,没有时间与他相处在一起。当有一天,你深入了解后,你会发现原不是你想像中的那么美好。
21. 活着一天,就是有福气,就该珍惜。当我哭泣我没有鞋子穿的时候,我发现有人却没有脚。
22. 多一分心力去注意别人,就少一分心力反省自己,你懂吗?
23. 憎恨别人对自己是一种很大的损失。
24. 每一个人都拥有生命,但并非每个人都懂得生命,乃至于珍惜生命。不了解生命的人,生命对他来说,是一种惩罚。
25. 情执是苦恼的原因,放下情执,你才能得到自在。
26. 不要太肯定自己的看法,这样子比较少后悔。
27. 当你对自己诚实的时候,世界上没有人能够欺骗得了你。
28. 用伤害别人的手段来掩饰自己缺点的人,是可耻的。
29. 默默的关怀与祝福别人,那是一种无形的布施。
30. 不要刻意去猜测他人的想法,如果你没有智慧与经验的正确判断,通常都会有错误的。
31. 要了解一个人,只需要看他的出发点与目的地是否相同,就可以知道他是否真心的。
32. 人生的真理,只是藏在平淡无味之中。
33. 不洗澡的人,硬擦香水是不会香的。名声与尊贵,是来自于真才实学的。有德自然香。
34. 时间总会过去的,让时间流走你的烦恼吧!
35. 你硬要把单纯的事情看得很严重,那样子你会很痛苦。
36. 永远扭曲别人善意的人,无药可救。
37. 说一句谎话,要编造十句谎话来弥补,何苦呢?
38. 白白的过一天,无所事事,就像犯了窃盗罪一样。
39. 广结众缘,就是不要去伤害任何一个人。
40. 沉默是毁谤最好的答覆。
41. 对人恭敬,就是在庄严你自己。
42. 拥有一颗无私的爱心,便拥有了一切。
43. 来是偶然的,走是必然的。所以你必须,随缘不变,不变随缘。
44. 慈悲是你最好的武器。
45. 只要面对现实,你才能超越现实。
46. 良心是每一个人最公正的审判官,你骗得了别人,却永远骗不了你自己的良心。
47. 不懂得自爱的人,是没有能力去爱别人的。
48. 有时候我们要冷静问问自已,我们在追求什么?我们活着为了什么?
49. 不要因为小小的争执,远离了你至亲的好友,也不要因为小小的怨恨,忘记了别人的大恩。
50. 感谢上苍我所拥有的,感谢上苍我所没有的。
51. 凡是能站在别人的角度为他人着想,这个就是慈悲。
52. 说话不要有攻击性,不要有杀伤力,不夸已能,不扬人恶,自然能化敌为友。
53. 诚实的面对你内心的矛盾和污点,不要欺骗你自己。
54. 因果不曾亏欠过我们什么,所以请不要抱怨。
55. 大多数的人一辈子只做了三件事;自欺、欺人、被人欺。
56. 心是最大的骗子,别人能骗你一时,而它却会骗你一辈子。
57. 只要自觉心安,东西南北都好。如有一人未度,切莫自己逃了。
58. 当你手中抓住一件东西不放时,你只能拥有这件东西,如果你肯放手,你就有机会选择别的。人的心若死执自己的观念,不肯放下,那么他的智慧也只能达到某种程度而已。
59. 如果你能够平平安安的渡过一天,那就是一种福气了。多少人在今天已经见不到明天的太阳,多少人在今天已经成了残废,多少人在今天已经失去了自由,多少人在今天已经家破人亡。
60. 你有你的生命观,我有我的生命观,我不干涉你。只要我能,我就感化你。如果不能,那我就认命。
61. 你希望掌握永恒,那你必须控制现在。
62. 恶口永远不要出自于我们的口中,不管他有多坏,有多恶。你愈骂他,你的心就被污染了,你要想,他就是你的善知识。
63. 别人可以违背因果,别人可以害我们,打我们,毁谤我们。可是我们不能因此而憎恨别人,为什么?我们一定要保有一颗完整的本性和一颗清净的心。
64. 如果一个人没有苦难的感受,就不容易对他人给予同情。你要学救苦救难的精神,就得先受苦受难。
65. 世界原本就不是属于你,因此你用不着抛弃,要抛弃的是一切的执著。万物皆为我所用,但非我所属。
66. 虽然我们不能改变周遭的世界,我们就只好改变自己,用慈悲心和智慧心来面对这一切。

posted @ 2007-02-01 12:40 Gin 阅读(491) | 评论 (0)编辑 收藏