scheme

Can't hide “Preferences” item in edit-menu

送分小仙女□ 提交于 2020-01-15 09:32:06
问题 How do I hide "Preferences" item in this picture when "undo and redo" items are able to hide? I tried using (preferences:hide-dialog) but there was no difference in GUI. #lang racket/gui (require framework) (define menu-super-frame% (frame:standard-menus-mixin frame:basic%)) (define menu-frame% (class menu-super-frame% (inherit get-file-menu set-icon) ;hiding items in edit menu (define/override (edit-menu:create-undo?) #f) (define/override (edit-menu:create-redo?) #f) (super-new))) (define

linux高阶-Nginx(九)-Rewrite相关功能

泄露秘密 提交于 2020-01-15 05:01:34
文章目录 Nginx Rewrite相关功能 1. ngx_http_rewrite_module模块指令 1.1 if指令 1.2 set指令 1.3 break指令 1.4 return指令 1.5 rewrite_log指令 2. rewrite指令 2.1 rewrite flag使用介绍 2.2 rewrite案例-域名永久与临时重定向 2.2.1 永久重定向 2.2.1 临时重定向 2.2.3 二者区别 2.3 rewrite案例-break与last 2.3.1 break案例 2.3.2 last案例 2.3.3 二者区别 2.4 rewrite案例-自动跳转https 2.5 rewrite案例-判断文件是否存在 3.nginx防盗链 3.1 实现web盗链 3.2 实现防盗链 Nginx Rewrite相关功能 1. ngx_http_rewrite_module模块指令 Nginx服务器利用ngx_http_rewrite_module 模块解析和处理rewrite请求,此功能依靠 PCRE(perl compatibleregularex pression),因此编译之前要安装PCRE库,rewrite是nginx服务器的重要功能之一,用于实现URL的重写,URL的重写是非常有用的功能,比如它可以在我们改变网站结构之后,不需要客户端修改原来的书签

racket/scheme filtering

喜欢而已 提交于 2020-01-14 19:05:11
问题 How would I filter this to display all vegetables? Thank you in advance. ("Pecan" . (1982 .("nut". "AL"))) ("Blackberry" . (2004 .("fruit". "AL"))) ("Peach" . (2006 .("fruit". "AL"))) ("Rice" . (2007 .("grain". "AR"))) ("Orange" . (2005 .("fruit". "FL"))) ("Huckleberry" . (2000 .("fruit". "ID"))) ("Blackberry" . (2004 .("fruit". "KY"))) ("Strawberry" . (1980 .("fruit". "LA"))) ("WildBlueberry" . (1991 .("fruit". "ME"))) ("BlueCrab" . (2000 .("food". "MD"))) ("HoneycrispApple" . (2006 .("fruit

Replace first occurrence of symbol in (possibly nested) list

心不动则不痛 提交于 2020-01-14 18:47:10
问题 I would like to replace just the first occurrence of a certain symbol (say '- ) with another symbol (say '+ ) inside a list that may contain lists. That is to say, '(((-))) would turn into '(((+))) '((-) - b) into '((+) - b) 回答1: Here's another, different option: using mutable state to find out when the first replace has happened: (define (replace-first) (let ((found #f)) (define (replacer exp old new) (cond ((null? exp) '()) ((not (pair? exp)) (cond ((and (eq? exp old) (not found)) (set!

Map a list of functions to a list

假如想象 提交于 2020-01-14 14:39:13
问题 This is homework, so I don't want the answer. I only need a push in the right direction. I am required to map multiple functions onto a list. For instance: (map-multi (list plus-one square) '(4 5 6)) => (25 36 49) I am able to have it map the first function to the elements of the list, however, I get very lost after that. Also, since this is introductory, I am limited to introductory functions ( const , append , car , cdr , member , etc.) (define (map-multi f l) (cond ((null? l) l) (else

Why won't `let` work for naming internal recursive procedures?

Deadly 提交于 2020-01-14 14:16:27
问题 Consider the following implementation of a function to compute factorial: [1] (define fac-tail (lambda (n) (define fac-tail-helper (lambda (n ac) (if (= 0 n) ac (fac-tail-helper (- n 1) (* n ac))))) (fac-tail-helper n 1))) I attempted to rewrite using let for the inner define: (define fac-tail-2 (lambda (n) (let ((fac-tail-helper-2 (lambda (n ac) (if (= 0 n) ac (fac-tail-helper-2 (- n 1) (* n ac)))))) (fac-tail-helper-2 n 1)))) There is no error at define time, but execution results in: #;>

Execute the following call/cc expression

孤人 提交于 2020-01-14 04:34:27
问题 I use racket and I got the result 4 for following simple code: (let/cc done ((let/cc esc (done (+ 1 (let/cc k (esc k))))) 3)) and I was going to execute this code step-by-step. First, I changed the first let/cc into the form of call/cc like below: (call/cc (λ (done) ((let/cc esc (done (+ 1 (let/cc k (esc k))))) 3))) Of course, this produces 4 also. Second, since I found the mechanism of call/cc in the internet which says call/cc do following 4 steps: Captures the current continuation.

Inserting at arbitrary position in list in Scheme

时光毁灭记忆、已成空白 提交于 2020-01-14 02:58:10
问题 I have a list with me, for example: (B D F) I want to insert an element at an arbitrary position in the list. For example, if the element is A, I want to insert it before B and if the element C, I want to insert it after B but before D. Is there any way to insert elements at an arbitrary position in a list in Scheme? 回答1: It's easy to implement a function for this: (define (insert-at new k lst) (cond ((null? lst) (list new)) ((zero? k) (cons new lst)) (else (cons (car lst) (insert-at new

Difference between OOP and Functional Programming (scheme) [closed]

泪湿孤枕 提交于 2020-01-13 03:23:32
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . I'm watching a video course/lectures from Stanford. The course is "The Structure and Interpretation of Computer Programs" In the first OOP lecture, the instructor (Brian Harvey) describes an OOP method as one

h5+mui分享调起app跳指定页面

六月ゝ 毕业季﹏ 提交于 2020-01-11 12:04:34
要先了解到URLScheme的作用 我们都知道苹果手机中的APP都有一个沙盒,APP就是一个信息孤岛,相互是不可以进行通信的。但是iOS的APP可以注册自己的URL Scheme,URL Scheme是为方便app之间互相调用而设计的。我们可以通过系统的OpenURL来打开该app,并可以传递一些参数。URL Scheme必须能唯一标识一个APP,如果你设置的URL Scheme与别的APP的URL Scheme冲突时,你的APP不一定会被启动起来。因为当你的APP在安装的时候,系统里面已经注册了你的URL Scheme。一般情况下,是会调用先安装的app。但是iOS的系统app的URL Scheme肯定是最高的。所以我们定义URL Scheme的时候,尽量避开系统app已经定义过的URL Scheme。 URL Schemes 有两个单词: URL,我们都很清楚,http://www.apple.com 就是个 URL,我们也叫它链接或网址; Schemes,表示的是一个 URL 中的一个位置——最初始的位置,即 😕/之前的那段字符。比如 http://www.apple.com 这个网址的 Schemes 是 http。 打开app跳转: 首先需要在manifest.json文件中配置为本App向手机注册id,及添加跳回本App的url schemes(协议)。