Expand Cut Tags

No cut tags
cbrachyrhynchos: (Default)

Using Racket to generate identicons:






I’ve always liked identicons, which WordPress and GitHub have used to great effect. The premise is simple: take a user identifier such as an IP or email address and deterministically convert it into an image based on a simple algorithm. To that I end I started hacking on Identikon - a little Racket program that generates different types of identicons based on rules modules.


cbrachyrhynchos: (Default)

Build Your Own Lisp, Chapter 4. Minimal interactive input reader.

Compiled with clang -std=c99 -g -Wall -lreadline ./prompt.c -o prompt.

#include <stdio.h>
#include <stdlib.h>
#include <readline/readline.h>
#include <readline/history.h>

//static char input[2048];
int main(int argc, char** argv) {
  puts("Lispy Version 0.0.0.0.1");
  puts("Press Ctrl+c to exit\n");

  //command loop forever until break
  while (1) {

    //use readline for input
    char* input = readline("lispy> ");

    //add input to command-line history
    add_history(input);

    //print out response.
    printf("No you're a %s\n",input);

    //free up our input buffer. 
    free(input);



  }

  return 0;


}
cbrachyrhynchos: (Default)

So, I decided to take on the quixotic task of creating a system for my writing files that imitates some of the features of yWriter and Scrivener, in text editors, but not emacs. Mostly because I needed a new programming project.

So the program is moving forward, or system I put together scripts that knit all of my scene files together and run word counts. I've been using multimarkdown metadata format to tag my scene files. So a scene that starts like this:

SceneTitle: Gideon's Vision    
Characters: Gideon, Marnia, Ulner    
Viewpoint: Gideon    
Setting: Miller's Rest, Priest's Home    
Synopsis: Caravan boss wants to go over the mountains. Marnia won't serve    
            guide. Gideon warns caravan boss off. Gideon has start of 
            vision.    
When: Start of story. 
RevisionNote: 130609 Needs rewrite.   

"Don't care how much you can pay, I'm not going over that pass," ...

Ends up looking like this if I choose to include the metadata and output to OpenOffice/LibreOffice format:

I can't really take much of the credit for conversion and typography. That's handled by multimarkdown. Markdown conversion is a nice area of development right now. Which is a big reason why I wanted to work in that world and not the LaTeX world.

I've been writing the scripts in Racket, a scheme dialect I've been playing with for the last few years for euler problems. Performance on my scripts so far is satisfactory. Most of the run time for the script is in loading the libraries. I need to resist the urge to over-optimize.

Profile

cbrachyrhynchos: (Default)
cbrachyrhynchos

July 2017

S M T W T F S
       1
234 5678
91011 1213 1415
16 17 1819202122
23 2425 26272829
3031     

Most Popular Tags

Syndicate

RSS Atom

Style Credit

Page generated Jul. 28th, 2017 07:00 pm
Powered by Dreamwidth Studios