This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; this small program helps to cite academic papers in Harvard style. it produces latex syntax (in a .txt file). | |
;; reference of sources (and link to the harvard style of citation) can be found at the end of this file. | |
(require racket/gui/base) | |
;; cite in havard style | |
(define frame (new frame% [label "cite"] | |
[min-width 500])) | |
;; callback of tab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; this inputs a csv file and produces table syntax in latex | |
;; file name sample to enter: gni.csv | |
;; it outputs automatically | |
;; note: csv file needs to be produced like this in libre: | |
;; the separator should be & (latex style) instead of ; or , | |
;; any commas left in the csv file should be switched to space or - | |
;; to avoid confusion because Racket reads csv with commas as separator | |
;; note: i leave the fixed number of columns to be 10 ^^ (for laziness) | |
;; that doesnt cause much trouble in latex though |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; CONCEPT | |
; this is a tutorial GUI for each function in racket | |
; the usage of each function will be demonstrated by interactive examples | |
; the interaction is made mostly with text fields (for entering data in general) and sliders (for numerical arguments) | |
; the idea is that user will see the result immediately as silder goes or text entered | |
; the results (evaluation) are printed out as messages on the canvas | |
;; how to run this | |
; to get into a programming environment: open terminal | |
; to load racket program, type in: racket |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; load the GUI package, picture package & the master file with some support functions | |
(require racket/gui/base | |
pict | |
"master.scm") | |
#| | |
SKETCH | |
______________________________________________ | |
|text field has an exemplary vector | |
|(hint message & error message) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; load the GUI package | |
(require racket/gui/base | |
"master.scm") | |
#| | |
SKETCH | |
______________________________________________ | |
|two text fields for two vectors ready to be appended | |
|(hint message & error message) | |
|--------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; load the GUI package | |
;; and the package that turns messages into picture (ie with color) | |
(require racket/gui/base | |
"master.scm") | |
(require pict) | |
;; SKETCH | |
; on the right, the workflow will be shown step by step by sliding the slider | |
#| | |
OPERATION PANE ILLUSTRATION PANE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require racket/gui/base | |
pict) | |
;; SUPPORT FUNCTIONS to read string entered in the text field | |
(define (read<-data s) | |
(read (open-input-string s))) | |
; read<-data is not able to catch extension (error) | |
; now we add that ability so it becomes (current-data...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; load the GUI package | |
(require racket/gui/base) | |
;; load the package for colorful message | |
(require pict) | |
;; load the support file | |
(require "master.scm") | |
;; the biggest canvas | |
(define big-frame (new frame% [label "cond"] | |
[min-width 1000])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE NEW VERSION ON GITHUB. DONT CHANGE THIS VERSION!!! JUST DONT!!! | |
;(require racket) ; for emacs to call REPL | |
(require racket/gui/base) ; to have TV | |
(require plot/no-gui) ; to have plot/dc | |
(require math/base) ; to have sum | |
;(require math) ; to have mean | |
;(require 2htdp/batch-io) ; to import csv | |
(require "csv.rkt") ; to export csv | |
(plot-new-window? #t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require racket) | |
(require math/matrix) | |
(define (array-sum an-array) | |
(for/sum ([x an-array]) x)) | |
;; absorbing markov chain | |
;; transition matrix P |
OlderNewer