Skip to content

Instantly share code, notes, and snippets.

Alex Harsányi alex-hhh

Block or report user

Report or block alex-hhh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@alex-hhh
alex-hhh / issue17.rkt
Created Oct 20, 2017
sample code for issue 17
View issue17.rkt
#lang racket
;; https://github.com/alex-hhh/ActivityLog2/issues/17
(require plot
racket/draw)
(require "al-interactive.rkt"
"../rkt/metrics.rkt"
"../rkt/series-meta.rkt")
(define candidates
View quantifying-fatigue.rkt
#lang racket
;; Script used to generate plots for the blog post below:
;;
;; https://alex-hhh.github.io/2017/11/quantifying-fatigue.html
;; You will need to clone https://github.com/alex-hhh/ActivityLog2 and fix the
;; require below to point to the al-interactive.rkt file. You will also need
;; to update the session ids as they reference activities in my own database.
@alex-hhh
alex-hhh / run-analysis.rkt
Created Dec 4, 2017
fatigue and running form scripts
View run-analysis.rkt
#lang racket
;; You will need to clone https://github.com/alex-hhh/ActivityLog2 and fix the
;; require below to point to the al-interactive.rkt file. You will also need
;; to update the session ids and season names as they reference activities in
;; my own database.
(require "../../ActivityLog2/etc/al-interactive.rkt"
"../../ActivityLog2/rkt/data-frame.rkt"
"../../ActivityLog2/rkt/fmt-util.rkt")
@alex-hhh
alex-hhh / ef-temperature.rkt
Last active Dec 22, 2017
efficiency-factor-and-temperature
View ef-temperature.rkt
#lang racket
;; See https://alex-hhh.github.io/2017/12/running-and-outdoor-temperature.html
;; You will need to clone https://github.com/alex-hhh/ActivityLog2 and fix the
;; require below to point to the al-interactive.rkt file. You will also need
;; to update the session ids as they reference activities in my own database.
(require plot)
(require "../../ActivityLog2/etc/al-interactive.rkt")
@alex-hhh
alex-hhh / plot-interactive-overlay-demo.rkt
Last active Feb 7, 2018
Plot interactive overlay demo
View plot-interactive-overlay-demo.rkt
#lang racket
;; Updated plot library required, https://github.com/alex-hhh/plot/tree/ah/interactive-overlays
(require plot pict)
;; Helper function to add a pict as a plot overlay -- don't want to add "pict"
;; as a dependency to the "plot" package
(define (add-pict-overlay plot-snip x y pict)
(send plot-snip add-general-overlay x y
(lambda (dc x y) (draw-pict pict dc x y))
(pict-width pict)
View plot-interactive-overlays-attempt2.rkt
#lang racket
;; Updated plot library required, https://github.com/alex-hhh/plot/tree/ah/interactive-overlays
(require plot pict)
;; Helper function to add a pict as a plot overlay -- don't want to add "pict"
;; as a dependency to the "plot" package
(define (add-pict-overlay plot-snip x y pict)
(send plot-snip add-general-overlay x y
(lambda (dc x y) (draw-pict pict dc x y))
(pict-width pict)
View plot-lib.patch
plot-doc/plot/scribblings/plotting.scrbl | 2 +-
plot-doc/plot/scribblings/renderer2d.scrbl | 2 +-
plot-gui-lib/plot/private/gui/snip2d.rkt | 25 +++++++++++++------------
plot-gui-lib/plot/snip.rkt | 2 +-
4 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/plot-doc/plot/scribblings/plotting.scrbl b/plot-doc/plot/scribblings/plotting.scrbl
index fa78670..b67fc8a 100644
--- a/plot-doc/plot/scribblings/plotting.scrbl
+++ b/plot-doc/plot/scribblings/plotting.scrbl
@alex-hhh
alex-hhh / current-value-fancy.rkt
Created Mar 20, 2018
Interactive overlays with the Racket Plot Package
View current-value-fancy.rkt
#lang racket
(require racket/gui mrlib/snip-canvas plot pict racket/draw)
(define (pie-slice w h angle)
(define nangle (let ((npi (floor (/ angle (* 2 pi)))))
(- angle (* 2 pi npi))))
(define (draw dc dx dy) (send dc draw-arc dx dy w h (- (/ nangle 2)) (/ nangle 2)))
(dc draw w h))
(define item-font (send the-font-list find-or-create-font 12 'default 'normal 'normal))
@alex-hhh
alex-hhh / double-dlg.rkt
Created May 8, 2018
Double dialog problem
View double-dlg.rkt
#lang racket
(require racket/gui)
;; Sequence of events to illustrate the problem:
;;
;; 1. Open Dialog 1
;;
;; 2. Open Dialog 2
;;
;; 3. Close Dialog 2 -- notice that dialog 1 now has focus
@alex-hhh
alex-hhh / gpx.rkt
Created Jun 13, 2018
Racket code to load GPX files
View gpx.rkt
#lang racket
(require xml
racket/date
(only-in srfi/19 string->date)
map-widget)
(provide gpx-load
gpx-lookup-position
gpx-lookup-elevation
gpx-total-distance)
You can’t perform that action at this time.