gyc567
gyc567 · 共 82 篇文章
illustrate how to implement a lisp interpreter
illustrate how to implement a lisp interpreter,see pic 1.lexer: lexer read and translate the input string "(+ 1 2 )" into tokens.(Pair) 2.parser: parser translate the tokens into AST(abstract syntax tree) 3.evaluator: evaluator evaluate the AST to a result. 4 return the result==>3,done. so easy!:)
2015-09-12 22:33 · lisp · interpreter · 评论(0)
怎样写一个解释器
怎样写一个解释器 这是一篇解释器的入门教程。虽然我试图从最基本的原理讲起,尽量让这篇文章不依赖于其它知识,但是这篇教程并不是针对编程的入门知识,所以我假设你已经学会了最基本的 Scheme 和函数式编程。我不是很推崇函数式编程,但它里面确实包含了很重要的一些方法。如果你完全不了解这些,可以读一下 SICP 的第一,二章(或者接下去读 The Little Schemer)。当然你也可以继续读这篇文章,有不懂的地方再去查资料。我在这里也会讲递归和模式匹配的原理。如果你已经了解这些东西,这里的内容也许可以加深你的理解。 解释器是一种简单却又深奥的东西,以至于好多人都不会写,或者自认为会写却又不真…
2015-05-07 15:41 · lisp · interpreter · 评论(0)
(An ((Even Better) Lisp) Interpreter (in Python))
(An ((Even Better) Lisp) Interpreter (in Python)) In a previous essay I showed how to write a simple Lisp interpreter in 90 lines of Python: lis.py . In this essay I make the implementation, lispy.py , three times more complicated, but more complete. Each section handles an addition. (1) New data t…
2015-05-05 20:31 · Python · lisp · compiler · interpreter · 评论(0)
Lispy: Scheme Interpreter in Python
################ Lispy: Scheme Interpreter in Python ## (c) Peter Norvig, 2010-14; See http://norvig.com/lispy.html ################ Types from __future__ import division Symbol = str # A Lisp Symbol is implemented as a Python str List = list # A Lisp List is implemented as a Python list Number = (…
2015-05-05 20:28 · lisp python · lisp · compiler · interpreter · 评论(0)
(How to Write a (Lisp) Interpreter (in Python))
(How to Write a (Lisp) Interpreter (in Python)) This page has two purposes: to describe how to implement computer language interpreters in general, and in particular to show how to implement a subset of the Scheme dialect of Lisp using Python . I call my language and interpreter Lispy ( lis.py ). Y…
2015-05-05 20:26 · Python · data structure & algorithm · lisp python · 评论(0)
Develop your todo list app with indexedDB
---------------------------------the HTML code is :--------------------- <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Todo List App</title> <link rel="stylesheet" href="style.css"> </head> <body> <div id="page-wrapper"> <!-- Form for new Todo Items --> <form id="new-todo-fo…
2015-04-12 13:47 · js · 评论(0)
ubuntu wifi issue for Qualcomm Atheros QCA9565 802.11b/g/n WiFi Adapter
1.we install the prerequitites needed to compile: Code: sudo apt-get install linux-headers-generic build-essential 2.Now we download the package, extract it and install it: Code: wget http://www.orbit-lab.org/kernel/compat-wireless-3-stable/v3.6/compat-wireless-3.6.6-1-snpc.tar.bz2 tar xvf compat* …
2015-03-22 11:28 · linux · 评论(0)
海量数据处理系列——BloomFilter
海量数据处理系列——BloomFilter 分类: 算法用的基础知识 2011-05-02 16:16 573人阅读 评论 (0) 收藏 举报 filter url 网络爬虫 数据库 算法 string 引自 http://www.cnblogs.com/heaad/archive/2011/01/02/1924195.html Bloom Filter是由Bloom在1970年提出的一种多哈希函数映射的快速查找算法。通常应用在一些需要快速判断某个元素是否属于集合,但是并不严格要求100%正确的场合。 一. 实例 为了说明Bloom Filter存在的重要意义,举一个实例: 假设要你写一个网…
2015-03-01 20:48 · data structure & algorithm · 评论(0)
海量数据处理系列——C语言下实现bitmap算法(转)
海量数据处理系列——C语言下实现bitmap算法 分类: 算法用的基础知识 2011-05-02 13:19 3161人阅读 评论 (6) 收藏 举报 语言 c filter 电话 扩展 存储 bitmap是一个十分有用的结构。所谓的Bit-map就是用一个bit位来标记某个元素对应的Value, 而Key即是该元素。由于采用了Bit为单位来存储数据,因此在存储空间方面,可以大大节省。 如果说了这么多还没明白什么是Bit-map,那么我们来看一个具体的例子,假设我们要对0-7内的5个元素(4,7,2,5,3)排序(这里假设这些元素没有重复)。那么我们就可以采用Bit-map的方法来达到排序的…
2015-03-01 20:40 · CoreJava · 评论(0)
理解HashMap(及hash函数的真正巧妙之处)
理解HashMap(及hash函数的真正巧妙之处) 〖 作者:annegu 〗〖 大小:2K 〗〖 发布日期:2009-12-03 〗〖 浏览:1 〗 <iframe id="aswift_1" style="left: 0px; position: absolute; top: 0px;" name="aswift_1" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" width="728" height="90"></iframe> /** *@author annegu *@date 2009-12-02 …
2013-08-08 08:06 · CoreJava · 评论(0)
UML类图与类的关系详解
UML类图与类的关系详解 2011-04-21 来源:网络 在画类图的时候,理清类和类之间的关系是重点。类的关系有泛化(Generalization)、实现(Realization)、依赖(Dependency)和关联(Association)。其中关联又分为一般关联关系和聚合关系(Aggregation),合成关系(Composition)。下面我们结合实例理解这些关系。 基本概念 类图(Class Diagram): 类图是面向对象系统建模中最常用和最重要的图,是定义其它图的基础。类图主要是用来显示系统中的类、接口以及它们之间的静态结构和关系的一种静态模型。 类图的3个基本组件:类名、属…
2013-08-08 07:46 · UML · 评论(1)
Linux下僵尸进程的处理
Linux下僵尸进程的处理 Category : 工作学习 / Tags : linux / Date : 2010.12.31 / 4,288 views / 什么是僵尸进程 僵尸进程是指它的父进程已经退出(父进程没有等待(调用wait/waitpid)它),而该进程dead之后没有进程接受,就成为僵尸进程,也就是(zombie)进程。 僵尸进程是怎么样产生 一个进程在调用exit命令结束自己的生命的时候,其实它并没有真正的被销毁,而是留下一个称为僵尸进程(Zombie)的数据结构(系统调用exit,它的作用是使进程退出,但也仅仅限于将一个正常的进程变成一个僵尸进程,并不能将其完全销毁)。…
2013-08-03 14:19 · linux · 评论(0)
SQL Injection Prevention Cheat Sheet
SQL Injection Prevention Cheat Sheet Contents [ hide ] 1 Introduction 2 Primary Defenses 2.1 Defense Option 1: Prepared Statements (Parameterized Queries) 2.2 Defense Option 2: Stored Procedures 2.3 Defense Option 3: Escaping All User Supplied Input 2.3.1 Database Specific Escaping Details 2.3.1.1 …
2013-07-26 10:45 · sql injection · 评论(0)
Preventing SQL Injection in Java
Preventing SQL Injection in Java Contents [ hide ] 1 Status 2 Overview 3 Example of SQL injection 4 Attack techniques 5 Defense Strategy 6 Parameterized Queries 6.1 Prepared Statements 6.2 Stored Procedures 6.3 Hibernate 7 Variable Binding 8 Dynamic Queries via String Concatenation 9 References Sta…
2013-07-26 10:17 · CoreJava · 评论(0)