freenode/#lisp - IRC Chatlog
Search
20:15:04
knusbaum
Trying to remember the FORMAT directive for printing one thing if the arg is T and another if it's NIL. I thought there was one.
20:21:15
pjb
knusbaum: ~:[ for alternatives. ~[ is for indexed cases. (format nil "~:[a~;b~]" 3) #| --> "b" |# (format nil "~[zero~;wouane~;too~;threeey~;foor~]" 3) #| --> "threeey" |#
20:40:29
Xach
I like to keep it really simple, plus a couple complicated things I use so much I remember the syntax. Mostly.
21:13:39
Bike
if you don't want to use format you can do pretty much everything it does with some particular macros and functions, it's just more diffuse
21:17:58
hjudt
Shinmera: regarding the organization of javascript files, you mentioned i should put my code into a separate file (because of caching?). i moved most code out to a common file now, however there will always be some code that is specific to the page. do you advise to separate this code out to an extra file too or is it ok to leave it in the html template inside a cdata block?
21:20:18
dim
but I don't remember it, I look it up or remember last time I used it when I need it again :/
21:21:15
dim
hjudt: I guess not cacching so much as cost to open a new connection on mobile devices in particular
21:23:09
hjudt
dim: so it's actually best to just separate out common code into e.g. common.js but leave page-specific code inside the template, right?
21:25:35
dim
for browser/user experience it's best to limit how many connections to open, unless using http/2 I think
21:27:16
hjudt
afaik there is no way to use http/2 with lisp yet. there is https://github.com/akamai/cl-http2-protocol, but this is not used by anything lispy.
21:30:02
hjudt
anyway, i am currently using radiance which is actually great with its api output to json and javascript to populate pages with data from ajax calls.
21:30:30
jmercouris
would it be considered bad practice to put all of my macros in a separate macros file?
21:43:36
jmercouris
hello everyone, I'm trying to get a simple macro expansion working, and I can't figure out what is wrong: https://pastebin.com/zgXz4HXQ
22:39:16
rpg
Is there a function (say in alexandria) that takes a list or a tree and an alist of substitutions, and does them all, instead of substituting one at a time?
1:59:18
jmercouris
hello everyone, I'm looking to store browser history, I was thinking about storing it in an SQLite db. What I'm concerned about is changability over time, and laginess with the size of the db growing
1:59:38
jmercouris
i was also thinking about using this sqlite interface: https://common-lisp.net/project/cl-sqlite/
2:22:41
jmercouris
pierpa: what about using a key-value db, wouldn't that be quicker for some types of queries? like for specific tags in history etc
2:25:22
jmercouris
pierpa: can you think of a good way to perform quick queries about the nature of non-numerical data in a sqlite db? e.g. if each element has a set of tags, how could I collect those quickly without maintaining a separate table for every tag?
2:25:44
jmercouris
as an example, find all history elements with the tag of "search engine query" or something like that
2:26:40
jmercouris
also if I have a table that points to them, the reverse relationship might take forever to query, e.g. what are the following tags associated with this history item
2:31:47
jmercouris
let me rephrase my question, let's say I had a bunch of items with specific tags, how can i query for items with tag x
2:33:10
Zhivago
Although if you want the tags to be primary keys, then they'll need to be in distinct columns.
2:34:23
Zhivago
You could set up another table for item-tag relationships, and then do an exciting join againt the item-data.
2:37:22
Zhivago
Then the tags could be in a single column and it would be potentially efficient to look up.
2:57:49
Zhivago
You'd end up with (item-id-1, tag-1), (item-id-1, tag-2), (item-id-2, tag-1), etc, tuples in the table.
2:58:43
Zhivago
Presumably the SQL system should be able to arrange its indexes to efficiently answer queries like "select item-id where tag='tag-1'".
2:59:30
jmercouris
Zhivago: I understand how that works for a single tag, but how could I query for multiple tags?
3:00:04
jmercouris
would I have to do multiple queries and a join? sorry for the questions, dbs are not one of my strong suits
3:07:18
pierpa
no, you do one query. The query optimizer of the DB will devise a way to perform the query efficiently
3:16:09
jmercouris
pierpa: is any of these the approach you describe? https://stackoverflow.com/questions/2885564/ways-to-implement-tags-pros-and-cons-of-each
3:18:57
jmercouris
pierpa: or did you mean this: https://stackoverflow.com/questions/3498844/sqlite-string-contains-other-string-query?
3:19:28
pierpa
I'm no DB expert, but I'd say way 1 and 3 are dumb, way 2 the only acceptable, but I may be wrong
3:21:52
pierpa
let me rephrase: way 3 is good, way 2 less so but is simpler and for small DBs may be viable, way 1 is dumb
3:22:24
jmercouris
so none of this:https://stackoverflow.com/questions/3498844/sqlite-string-contains-other-string-query
3:24:57
pierpa
do you really need to match substrings, or you considered this only as a possible approach?
3:25:42
jmercouris
it doesn't strongly matter to me how the data is matched, just that there are tags
3:26:02
jmercouris
pierpa: as of now, I am not doing it in any way, i haven't started on the implementation yet, just seeking advice before i start
3:26:30
jmercouris
I'm not sure how people will want to query their history, by date, by tags? by url?
3:26:34
pierpa
I think storing tags as a comma separated list of names in a string is not a good idea
5:29:33
mfiano
estimated from log file sizes with non-channel-messages stripped, for about a decade of data, that is.
5:31:30
mfiano
It has been a bit less active the last month or 2, but that is expected to pick up again next month when the jam starts. might be a good time to mention if anyone is interested: https://itch.io/jam/lisp-game-jam-2017-hard-mode
6:23:24
Shinmera
hjudt: If you have few pages, make a file per page. If you have lots with little code, make one file that activates the code depending on which page you're on.