Content from 2014-12
I was reading Blaster Nation, today (all of it!) and it made me miss my friends. So I set up a mumble server and a Google Calendar, and we're going to see if we can play games together, even just randomly, but also in some planned state.
In my mind, it could be something like twitch, or steam, or maybe really it should be like meetup for playing with friends.
Maybe that would be a fun project?
Eventually, I'd want to send messages only to followers and have them show up in the nav bar as notifications, but this was mostly meant as a proof of concept, anyway. I'd much rather go write a new sql library for lisp, now, that try to finish everything. At some point, paging chirps so you can scroll to fetch more would be good.
This was sort of my minimum product for this project, but I might polish it more as I have time.
Eventually, I realized that in the slot definition
(created-at :type clsql:wall-time
the time stamp would always be the current if the time wasn't set on the instance when the database was read.
I'd recently started using clsql-helper to get instances of classes back from complicated SQL queries. By 'complicated' I mean 'contains a basic join.' Apparently, CLSQL doesn't feel it needs to do that. I wish I knew why.
In any event, when I used clsql-helper, the dates were wrong, when I used
#'select, the dates were correct. So it slowly dawned on me that
clsql-helperwas doing something wrong. Sure enough, it wasn't converting the string that the time stamp returned into the
wall-timeinstance that clsql expected.
So I took the chance to play around with the
MOPa bit and wrote code to convert the values to the right type, looking at their slot definitions in the class.
(defun get-slot-by-name (name class)
(find name (closer-mop:class-direct-slots (find-class class))
:key (lambda (slot)
(intern (symbol-name (closer-mop:slot-definition-name slot))
(defun coerce-value-to-column-type (class column value)
(let ((type (clsql-sys::specified-type (get-slot-by-name column class))))
(coerce-value-to-db-type value type)))
With that code, you just do something like
(coerce-value-to-column-type class coulmn data)
and things come out the right way.
This blog covers vegan, ice cream, Work, Vegan, Uncategorized, Rust, Resistance, Research, Repair, Recipes, Physics, Nest, Music, Lisp, Linux, Links, Link, Life, Language, Information, Image, Gnome, Games, Gallery, Food, Fascism, Esperanto, Emacs, Electronics, Education, Dog, Did You Know That?, DRM, Community, Comics, Colgate, Code, Buddhism, Books, Aside, Anarchism, 3D Printing
View content from 2009-04, 2009-06, 2009-07, 2009-08, 2009-10, 2009-11, 2009-12, 2010-05, 2010-06, 2010-07, 2010-08, 2010-09, 2011-01, 2011-02, 2011-03, 2011-04, 2011-06, 2011-07, 2011-08, 2011-09, 2011-10, 2011-11, 2011-12, 2012-01, 2012-02, 2012-03, 2012-04, 2012-07, 2012-08, 2012-09, 2012-11, 2013-02, 2013-03, 2013-04, 2013-06, 2013-07, 2013-09, 2013-11, 2014-01, 2014-02, 2014-03, 2014-07, 2014-11, 2014-12, 2015-01, 2015-02, 2015-07, 2015-10, 2015-11, 2015-12, 2016-01, 2016-05, 2016-08, 2016-10, 2016-11, 2016-12, 2017-02, 2017-06, 2018-04, 2019-03, 2009-03