Archive for the 'Code' Category

Gtk Pie Chart Widget

Tuesday, June 10th, 2008

I needed a pie chart widget for a project so I made one. I used cairo for rendering of course. This API has add_segment and remove_segment functions but I will change that to take a tree model. There are almost no options or style at this point which would obviously be important but I have [...]

DMS to Decimal By Request

Thursday, January 17th, 2008

This is a function from my library that can be used to decode a degrees-minutes-seconds (DMS) string to a decimal degrees.
Enjoy.

/* ——————————
Function: geo_dms_to_deg
Parse a degrees-minutes-seconds (DMS) value string into a double floating
point in degrees.
 
Parameters:
str [...]

Dos2unix in Emacs, Sometimes Macros Are Nice

Friday, November 30th, 2007

This is just a generic search and replace. Really you could make a macro for any search and replace you do on a regular basis.

;;; A interactive function for replacing all dos
;;; carriage returns (^M) with Unix
;;; line feeds in a selected buffer.
(defun dos2unix (buffer)
"Automate M-% C-q C-m RET C-q C-j [...]


Bad Behavior has blocked 149 access attempts in the last 7 days.