00:00:00 <luite> hmm
00:00:03 <donri> i wonder if them concurrent data structures are relevant to this?
00:00:37 <stepcut> luite: or a masters/phd student ;)
00:00:38 <luite> not really
00:01:24 <luite> donri: you need to update through some transactional layer anyway, concurrent data structures are for lock-free concurrent readers/writers
00:02:31 <luite> stepcut: possibly, but it's not really a research-level task with these features. it could perhaps be one if someone comes up with some awesome new things that have never been done before
00:02:50 <stepcut> luite: sounds good to me :)
00:02:54 <luite> hehe
11:16:33 <Palmik> Hmm, have it ever happened to you that certain acid-state events seemed to be no-op?
11:55:23 <Lemmih> In what way?
12:44:58 <Palmik> Lemmih, well, I have a function that inserts a new identity like this http://hpaste.org/73163) that is called when I signup new credentials. The thing is that the ID it returns is always 1 (the initial one), then, even if I try to lookup identity with ID 1, I get nothing. But other things, like inserting/lookingup password bundles or credentials works.
13:04:14 <Lemmih> Does the event log grow?
13:16:38 <Palmik> I will try it out.
13:25:22 <Palmik> Hmm, if I try it from GHCi (just the inserting), I get always the ID on consecutive tries (but when I restart the GHCi session, the ID I get changes) and the log grows. I will see if the log grows when I use it from withing the application.
13:25:44 <Palmik> (always the same ID on consecutive tries)
13:35:20 <Palmik> So, when I deleted the state folder and used the application as I normally do, the log (related to the AcidState that's used fro inserting the identities) grows, but the only event name I see there is "Signup" which is an event that internally calls "Insert" (inserts identity), but it's name is not in the log (the event log from the GHCi testing contained the Insert event).
13:36:31 <Palmik> But there is probably no reason to log the Insert event, when Signup is logged (Signup calls Insert after all anyway).
13:36:48 <Palmik> So maybe this part is not abnormal.
13:40:14 <Palmik> I have added an annotation to the original paste (http://hpaste.org/73163) that contains the signup event definition.
13:42:58 <Lemmih> Hm.
15:20:41 <Palmik> Lemmih, here is some more code. The first part shows how I try the code in GHCi... now the results are a bit different (probably because previously I wrapped openLocalState with bracket with createCheckpointAndClose (that's what I do in my app)... that would explain few things). There is also a second snippet that includes relevant parts from my application (simplified), but it works flawlessly (so I guess the problem lies in a code that was not shown).
15:20:48 <Palmik> On, and the link http://hpaste.org/73176
15:21:53 <Lemmih> Ah, yes. Opening multiple AcidStates at the same time doesn't quite work.
15:22:08 <Lemmih> I should give a proper error message.
15:23:04 <Palmik> Hmm, but it does not work even in the thescase where I open only single AcidState.
15:23:46 <Lemmih> Oh?
15:24:14 <Palmik> The first snippet.
15:24:25 <Palmik> http://hpaste.org/73176
15:24:49 <Lemmih> You're opening it three times.
15:24:59 <Lemmih> Once in initCoreState, twice in insert1.
15:25:20 <Palmik> Aah, you are right.
15:25:57 <Palmik> So that explains the problem with the snippet, but not the actual application :/
15:27:18 <Palmik> And initCoreState is only the initial CoreState value that is passed in case there is no state saved to disk yet, but your point still stands.
15:30:28 <Lemmih> Let me know if I can do anything to help.
15:35:02 <Palmik> So, the exception goes away when I add "<* AS.createCheckpointAndClose st", then results are same as when I used the backeted version (as expected), that is when I first run insert1, the ID is seemingly random and does not change after another insert1. Well, I will let you know if I figure something out.
15:38:02 <Palmik> Hmm, by "opening multiple AcidStates at the same time", do you mean jsut opening single AcidState more than once or opening multiple AcidState (each only once)?
15:41:21 <stepcut> you can open a lot of different acid-states at once, but each single one should only be opened once
15:42:07 <Palmik> OK, I thought so, since the crashcourse presents that.
15:42:44 <stepcut> what does your Indexable instance look like?
15:48:24 <Palmik> stepcut, like this http://hpaste.org/73180 (I have just noticed that I have the whole identity as a second key, but I do not use it anywhere)
15:51:53 <stepcut> looking at this paste:
15:51:54 <stepcut> http://hpaste.org/73163
15:52:09 <stepcut> is 'signup' calling that 'insert' ?
15:52:45 <Palmik> Yes.
15:53:10 <stepcut> well, signup does a get and a put, overwritten any put that the insert does, yes ?
15:53:31 <Palmik> Oh my...
15:53:34 <Palmik> You are right.
15:55:25 <Palmik> Good catch, thanks. :)
16:54:51 <donri> heh, "IdentityID"
16:55:05 <donri> @google RAS syndrome
16:55:07 <lambdabot> http://en.wikipedia.org/wiki/RAS_syndrome
16:55:07 <lambdabot> Title: RAS syndrome - Wikipedia, the free encyclopedia
17:52:13 <Palmik> I do not think that is really applicable here, since IdentityID is different from Identity (identity represents user's identity whereas identityID is ID of the object). If you can come up with better naming convention, I will gladly listen.
19:59:37 <zzing_> What is clckwrks capable of without me writing a line of code?
20:02:21 <zzing_> Bonjour!
20:03:41 <stepkut> zzing_: basic blogging. though at the moment, you do need to modify a few lines to get that going.
20:03:58 <stepkut> well blogging and creating pages/menus
20:04:30 <stepkut> there are a few plugins, but none are really that complete yet (media gallery, ircbot, bug tracking, etc)
20:05:01 <stepkut> i use it for making sites like happstack.com and clckwrks.com
20:05:11 <stepkut> hope to add support for billing soon
20:05:17 <stepkut> and darcs source browsing
20:08:17 <stepkut> got a ways to go until we can really squash wordpress :)
20:13:27 <zzing_> stepkut, I will tell you what I want to replace, and maybe you can tell me if clckwrks is simple enough to use for it...
20:13:39 <zzing_> http://socr.uwindsor.ca/
20:13:58 <zzing_> Basically I need the ability to drop html files in
20:14:16 <zzing_> A sort of heirachy is visible on the documents link
20:14:36 <zzing_> Right now it is generated from markdown with perl and it is decent, but I would love online modification of the html
20:14:46 <zzing_> I just don't want to get bogged down in making something myself
20:15:18 <stepkut> that could be done using clckwrks. The pages are editable in the browser and the input is markdown.
20:15:39 <zzing_> Can the input just be changed to be html?
20:15:41 <stepkut> the menu can be editted interactively as well.. though it the editor is a bit ugly at the moment
20:16:36 <stepkut> not really.. you can try putting html inside of markdown, but it won't behave exactly right I expect
20:16:48 <zzing_> stepkut, I don't know if you remember I was trying out happstack earlier, then tried snap later on.  The theme is obvious :P
20:16:54 <stepkut> yup
20:17:35 <zzing_> stepkut, if you are just calling markdown for the content, can't that just be replaced with something that takes html?
20:18:00 <stepkut> yes, in theory. But, that would involve writing some code
20:18:40 <stepkut> though perhaps not much
20:19:04 <zzing_> Can clckwrks be used with fastcgi?
20:19:11 <stepkut> zzing_: no
20:19:25 <stepkut> the happstack-fastcgi library is really out of date.
20:19:38 <stepkut> don't plan to fix that until we have the new http backend written
20:19:48 <stepkut> though.. it's not a lot of code if someone wanted to fix it sooner
20:19:52 <zzing_> It should be workable through a proxy
20:20:07 <stepkut> i use happstack behind an apache proxy
20:20:35 <zzing_> How about https? regular viewing is fine but for logins and edits https is highly desriable
20:22:07 <stepkut> you can run it behind an https proxy. happstack-server-tls provides https support, but it has not been integrated into clckwrks yet
20:22:11 <stepkut> though it is on the TODO list for 1.0
20:22:44 <zzing_> What kind of time period are we looking at for 1.0?
20:24:21 <zzing_> Is there anything wrong with setting up apache to have both https and http proxy to the same clckwrks and have clckwrks use https for logging in and after authentication it doesn't matter
20:25:46 <stepkut> well.. there are some auth tokens that get transmitted in the cookies after you login.. so you might want to stick with https after login
20:26:11 <zzing_> ok, how hard is it to get it to do what we just described here?
20:27:05 <stepkut> hmm
20:27:29 <stepkut> configuring apache is pretty easy if you know how
20:27:42 <zzing_> Tell apache to use a certain protocol on certain urls?
20:28:27 <stepkut> sure
20:28:58 <zzing_> ok, I think this sounds like it is decent enough to give it a shot
20:29:10 <stepkut> i think a better option might be to have it just do http and https
20:29:26 <stepkut> but, when the click on the login link, have it redirect them from http https
20:29:35 <stepkut> then stay at https so the auth cookie can't be stolen?
20:29:45 <zzing_> probably decent
20:29:51 <zzing_> I just want to make sure the site is relatively fast
20:30:03 <stepkut> the other part is modifying clckwrks to allow rawhtml to be inserted in the page
20:30:27 <zzing_> markdown usually ignores html and passes it through
20:30:35 <stepkut> right
20:30:40 <zzing_> and the site right now is markdown, so it is really only certain parts that are an issue
20:30:48 <stepkut> if that is good enough for you, then you can just use markdown with embedded html
20:30:57 <stepkut> that definitely works
20:33:48 <zzing_> Are you around for the next few hours if I have issues?
20:34:30 <stepkut> sort of
20:34:53 <stepkut> I am about to go out for a little, and then I will be entertaining a 5 year old for a bit
20:35:05 <stepkut> so.. I'll be able to answer quick things, but not in-depth
20:35:48 <zzing_> ok, its probably going to be decent enough but for quick things
20:36:01 <zzing_> 5 year olds - are they anything like big 3 year olds?
20:36:42 <stepkut> a bit, but fairly different as well
21:01:03 <donri> they're like 3 year olds but with an ear in their beer
21:02:06 <stepcut> donri: :)
21:40:33 <donri> I wonder how feasible and beneficial it would be to hook web-routes into acid-state á la pyramid's traversal, such that for example you can't produce a link with an ID that doesn't exist
21:41:57 <stepcut> donri: seems like that would add a bunch of extra queries to generate the page… and if the id is invalid, then what?
21:42:12 <donri> stepcut: 404
21:42:44 <donri> and queries are cheap ;)
21:42:53 <stepcut> you want a page to be 404, just because it tries to create a bad link?
21:43:55 <donri> i suppose it would still be trivial to create  Page value detached from acid-state... although you could hide that from exports
21:44:21 <stepcut> still not clear how this is delivering a better end user experience
21:44:51 <stepcut> detecting errors like that at compile time is great.. but by runtime.. there is not much you can really do?
21:45:16 <stepcut> also, in my experience, PageIds don't just come from thin air.. they are usually the result of a previous query.. so they are usually good..
21:45:34 <donri> well type-safe routing is only safe in static portions... with traversal, you actually use the data in your DB to create URLs, so you can't trivially even create a link or redirect to a page that 404s
21:46:12 <donri> aaaaand i'm just thinking out loud, haven't really had issues with dynamic portions in web-routes
21:46:23 <stepcut> yeah
21:46:51 <stepcut> like I said.. for the dynamic stuff.. you are usually getting the dynamic values from a source that is already correct, so there is not much room for things to go wrong
21:47:49 <donri> but for example, you could hide the Page constructor from export, such that you can only create it with an acid-state update, and then build an URL from it via some type class
21:48:24 <donri> yea, it's just a bit embarrasing that python is "safer", even if it's in a way that's not super-useful ;)
21:51:05 <stepcut> i still don't see how that is safer
21:52:26 <stepcut> you could try to make things safer by not exporting the PageId constructor.. and making it so that the only way to get a PageId is via some safe functions.. but you could still store a safe PageId and then try to use it again later when it is invalid..
21:53:46 <donri> because you can't do, <a href=(Page 5)/>, but have to do, page <- query PageByID 5; maybe (const mzero) (\page' -> <a href=page'/>) page
21:53:48 <donri> or whatever
21:54:12 <stepcut> and how does that make things better for the site visitor?
21:54:25 <stepcut> they get a link that doesn't go anywhere useful either way, yes?
21:55:07 <donri> well instead of a link to a page that 404s, you handle the failure in the link-generating handler
21:55:35 <donri> for example say that "5" comes from a ?query argument
21:55:54 <donri> instead of mzero we could return some more useful error, instead of a 200 OK with a broken link
21:56:15 <stepcut> how is that useful to the end user?
21:56:45 <donri> clearer/earlier error messages?
21:57:17 <donri> (not sure if you're saying it's not very important, or if you're actually missing the point?)
21:57:33 <donri> (because i agree it's not very important ;))
21:58:15 <stepcut> I just don't get it. I go to a web page that has a bad link on it.. and I get a more descriptive error of something I have no control over?
21:59:04 <stepcut> and.. the thing that makes it more descriptive, is that the error message knows what page the url came from ?
22:00:53 <donri> hm not sure it makes as much sense in haskell... in python you have a tree structure of your data that's similar to filesystem paths
22:02:21 <donri> so for a blog with categories you might actually store posts under root['Haskell'] and then when you browse /blog/Haskell that actually loads up the tree of Haskell posts that you then render in a template, etc
22:04:03 <donri> so it does the db query for you, and routes are directly mapped to entries in the DB tree
22:09:08 <stepcut> ah
22:10:12 <donri> i think it was designed for convenience and safety wasn't even a factor, but it's a side-effect i think
22:10:26 <luite> you mean like red wikipedia links?
22:10:27 <stepcut> :)
22:10:51 <donri> red wikipedia links have a use, "create this article"
22:11:21 <donri> or do you mean the fact they're red, so you know in advance if it exists?
22:11:39 <luite> yeah
22:12:49 <donri> i think rather that would be harder to do with traversal... although they do provide other means of generating URLs
22:14:36 <luite> persistent probably already does something like you're describing
22:14:47 <donri> basically they have a concept of a "resource" object that represents a datum, or a collection of data, and each resource have a "parent" resource up until the root, and these parents depend on how you got the resource from the DB
22:15:30 <donri> so if you just create a datum detached from the DB, it will have no parent
22:16:19 <stepkut> for something like wikipedia you could implement a special version of showURL that matches on (WikiWord Text) and does a lookup to see that it exists. If not, it changes the URL to (CreateWikiPage Text)
22:16:38 <stepkut> then use that to define your EmbedAsChild instances, etc
22:18:52 <donri> makes me wonder if the wikimarkup is rendered on each page view, since redlinks could go blue any time an article is created?
22:19:10 <donri> or they cache which links are red to bust the cache
23:30:57 <zzing_> stepkut, can a google account be used securely without me having to do anything special? I notice the clckwrks site does this
23:33:49 <stepkut> hmm
23:35:06 <stepkut> once the user is authenticated, they will use a clckwrks based auth cookie -- that should, ideally, be only sent on https
23:35:46 <stepkut> for the openid stuff.. I am not clear how big of a security risk it is for the token sent by google to be intercepted
23:36:09 <zzing_> oh one other thing - how is theming done
23:36:17 <stepkut> in theory, if someone stole that token, and then did a man in the middle attack where they made your server think it was talking to google, then they could fake it..
23:37:24 <zzing_> ignoring the potential security ramification, it is something I definitely want to try
23:40:26 <stepkut> perhaps the openid authentication stuff should be sent back from google over https
23:41:11 <stepkut> the happstack-authenticate library pre-dates happstack-server-tls, so we need to update it to take advantage of https now that we have it
23:43:41 <zzing_> stepkut, if I get some spare time away from my other haskell project, and I end up using clckwrks, maybe I can look at some stuff
23:44:34 <stepkut> nice
23:45:56 <zzing_> stepkut, especially I would like fastcgi
23:46:08 <zzing_> It sounds like a number of really useful things are just needing to be updated
23:46:16 <stepkut> yeah
23:46:41 <stepkut> stuff is happening, but things could happen faster :)
23:47:09 <stepkut> I am currently working on my CUFP presentation, so, that is taking away from other things
23:47:19 <zzing_> What is that
23:47:32 <stepkut> http://www.happstack.com/c/view-page-slug/13/cufp2012
23:48:55 <zzing_> I am surprised darcs is being used, git seems to have become fashionable of late :P
23:50:06 <stepkut> fashionable and good are not the same thing :)
23:50:37 <stepkut> when happstack was first started git was really ungood and github did not exist
23:50:56 <zzing_> ok, I love github, but could use private stuff for free too
23:51:13 <zzing_> I would like to suggest you say what 'magic' is as a library on the get-started page
23:51:39 <stepkut> it does magic!
23:51:44 <zzing_> I be
23:51:45 <zzing_> t
23:52:02 <stepkut> actually, it just looks at a file and tries to guess what is inside it.. like image/jpeg, etc
23:52:11 <stepkut> based on the 'magic bytes' at the beginning of the file
23:54:18 <zzing_> Well I have a python port for it, but can't find the real thing yet
23:54:36 <stepkut> what distribution?
23:54:41 <zzing_> FreeBSD
23:56:48 <zzing_> I think it is integrated
23:56:54 <zzing_> I have a /usr/lib/libmagic
23:57:46 <stepkut> yes, I was about to say that
23:58:05 <donri> git is great at everything except managing patches
23:58:19 <donri> or UI
23:58:20 <stepkut> :)
23:59:10 <donri> travis is also a reason i use git[hub]; too lazy to mess with bridge and neat that you can flip a switch to get some CI for smaller projects
23:59:37 <zzing_> donri, UI?