Say we want to modify the docs of errortrace
, which is bundled with
the main distribution. I assume the system is a Unix.
- Install Racket from a binary as a local distribution, so you don't have to use sudo/root.
#lang racket/base | |
(require quickscript | |
racket/list | |
racket/class | |
racket/gui/event) | |
(script-help-string "Like pressing Enter, but keeps the comments at the end of the line") | |
;;; Author: Laurent Orseau <laurent.orseau@gmail.com> |
#lang racket/base | |
; One way to define a logger | |
(define lg (make-logger 'my-logger)) | |
; Define a receiver for this logger, along with a log level | |
(define rc (make-log-receiver lg 'error)) ; also try with 'debug | |
; Another way to define a logger, with additional forms | |
(define-logger lg2) | |
(define rc2 (make-log-receiver lg2-logger 'debug)) |
#lang racket/base | |
;;; Author: Laurent Orseau https://github.com/Metaxal | |
;;; License: [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) or | |
;;; [MIT license](http://opensource.org/licenses/MIT) at your option. | |
(require quickscript | |
racket/string | |
racket/class) |
#lang racket/base | |
(provide latex-math-chars) | |
;;; LaTeX math to Unicode symbols translation dictionaries. | |
;;; Adapted from | |
;;; anaconda/lib/python2.7/site-packages/docutils/utils/math/tex2unichar.py | |
;;; itself generated with ``write_tex2unichar.py`` from the data in | |
;;; http://milde.users.sourceforge.net/LUCR/Math/ | |
;;; Includes commands from: wasysym, stmaryrd, mathdots, mathabx, esint, bbold, amsxtra, amsmath, amssymb, standard LaTeX |
#lang racket/gui | |
(define fr (new frame% [label "Tab example"])) | |
(define (tab-panel-set-tab tp idx) | |
(send tp change-children | |
(λ (previous-children) | |
(list (list-ref tab-contents idx))))) | |
(define tp (new tab-panel% |
Say we want to modify the docs of errortrace
, which is bundled with
the main distribution. I assume the system is a Unix.
#lang racket/base | |
;;; Author: Laurent Orseau | |
;;; License: [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) or | |
;;; [MIT license](http://opensource.org/licenses/MIT) at your option. | |
(require quickscript | |
quickscript/utils | |
racket/file | |
racket/path |
#lang racket | |
(require plot) | |
(define (tlayout low high) | |
(list | |
; major ticks: tick is shown with label | |
(pre-tick pi #t) | |
(pre-tick (sqrt 2) #t) | |
(pre-tick 0.5 #t) | |
; minor ticks: tick is shown, but without label |
#lang racket/base | |
(require quickscript | |
racket/gui/base | |
racket/class | |
racket/list | |
search-list-box) | |
(provide (except-out (all-defined-out) | |
search-list-box-filter)) |
#lang racket | |
(require racket/fixnum | |
math/base) | |
;;; Conclusion: hasheq-ref is (slightly) faster than a custom binary search | |
;;; (It's actually probably implemented as a binary search, with some more optimization, | |
;;; as the bin search is within a factor 2) | |
(#%declare #:unsafe) |