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
;;;; | |
;;;; a flash widget that fades out dynamically without another HTTP request | |
;;;; | |
(proclaim '(optimize (debug 3))) | |
(in-package :lisp-blog) | |
(export '(fading-flash fading-flash-messages fading-flash-message)) | |
(defwidget fading-flash (flash) | |
((delay :accessor fading-flash-delay |
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
(defclass cons-presentation-mixin () | |
((car-type :accessor cons-presentation-car-type | |
:initarg :car-type) | |
(cdr-type :accessor cons-presentation-cdr-type | |
:initarg :cdr-type)) | |
(:documentation "A presentation for conses.")) | |
(defclass cons-presentation (presentation cons-presentation-mixin) | |
() | |
) |
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
#include <istream> | |
#include <stdexcept> | |
#include <string> | |
#include <sstream> | |
#include "text_config.hpp" | |
namespace { | |
std::string get_section_name(std::string& line) | |
{ |
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
#include <istream> | |
#include <map> | |
#include <string> | |
#include <sstream> | |
class text_config | |
: public std::map<std::string, std::map<std::string, std::string> > | |
{ | |
public: | |
friend std::istream& operator>>(std::istream&, text_config&); |
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
(defpackage :slimtimer | |
(:use :cl) | |
(:export :with-xml :start-session :list-tasks :list-entries)) | |
(in-package :slimtimer) | |
(require 'drakma) | |
(require 's-xml) | |
(require 'babel) | |
(require 'cl-who) |
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
(in-package :slimtimer) | |
(export '(time-entry-task task-name task-hours task-last)) | |
(require :s-xml) | |
(defmacro with-xml (&body body) | |
`(with-output-to-string (ss) | |
(format ss "<?xml version=1.0\" encoding=\"utf-8\"?>") | |
(cl-who:with-html-output (ss) | |
,@body))) |
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
type FieldValue<'a when 'a : (static member Parse: string -> 'a)>(arg:string) = | |
let value = 'a.Parse(arg) | |
member m.Value = value |
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
> type Test<'a when 'a: (static member Parse: string -> 'a)>(arg:string) = let value = arg;; | |
type Test< ^a when ^a : (static member Parse : string -> ^a)> = | |
class | |
new : arg:string -> Test< ^a> | |
end | |
// reflected as: | |
[Serializable, CompilationMapping(SourceConstructFlags.ObjectType)] |
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
class Base | |
{ | |
Base() | |
{ | |
PostChildConstructorEvent += (() => /* do something after Thing is done initializing */); | |
} | |
} | |
class Thing : Base | |
{ |
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
#light | |
#r @"C:\Users\Ben\Development\.NET\FParsec\Build\Release\FParsecCS.dll" | |
#r @"C:\Users\Ben\Development\.NET\FParsec\Build\Release\FParsec.dll" | |
open FParsec.Primitives | |
open FParsec.CharParsers | |
let s0 = @"~01001~^~0100~^~Butter, salted~^~BUTTER,WITH SALT~^~~^~~^~Y~^~~^0^~~^6.38^4.27^8.79^3.87" | |
let s1 = "~01001~^~0100~^~Butter, salted~^~BUTTER,WITH SALT~^~~^~~^~Y~^~~^0^~~^6.38^4.27^8.79^3.87 |
OlderNewer