posted on 2014-12-16 19:53:00
Over the last few years, with college done and friends scattered out over the US. It's been hard to keep in touch and, every time I do see people, we talk about how we'd like to keep in better touch.
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?
posted on 2014-12-05 17:57:00
I finally got Chirp
working with websockets! Well, it had worked before, but just sent down all the chirps that existed. Now it updates in real-time when someone else chirps. Though, it sends it to everyone, so don't say anything you'd want kept secret!
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.
posted on 2014-12-01 20:30:00
I was poking around at my project, Chirp
, today and finally decided to deal with a strange bug I was having. When I sent JSON down to the AngularJS controller that renders the page, dates were always coming back as the time the request was made at. This was strange, since the database records of the chirps store when they were created, and the time should have been that. The one I was testing was over a week old.
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
, the dates were correct. So it slowly dawned on me that
was doing something wrong. Sure enough, it wasn't converting the string that the time stamp returned into the
instance that clsql expected.
So I took the chance to play around with the
a 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, Esperante, Emacs, Electronics, Education, Dog, Did You Know That?, DRM, Community, Comics, Colgate, Code, Buddhism, Books, Aside, Anarchism, 3D Printing
View content from 2009-03, 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