tag:blogger.com,1999:blog-187209712009-02-20T15:51:56.684-08:00What was I thinking...En blogg av en person som väldigt enkelt blir "side tracked".Johan Carlssonhttp://www.blogger.com/profile/15834022591521598070noreply@blogger.comBlogger22125tag:blogger.com,1999:blog-18720971.post-1148027370524760832006-05-19T01:28:00.000-07:002006-05-19T01:29:30.536-07:00Someone else but mee...that have get used to the fact that Firefox crashes frequently?<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18720971-114802737052476083?l=you-own-that.blogspot.com'/></div>Johan Carlssonhttp://www.blogger.com/profile/15834022591521598070noreply@blogger.com0tag:blogger.com,1999:blog-18720971.post-1147958582439602342006-05-18T06:22:00.000-07:002006-05-18T06:23:02.460-07:00"Blåser av lite ånga" för att tala svengelska, "som du gör".<br /><br />Adobe är ett företag som är som en nagel i ögat,<br />man blir alltid besviken på dom.<br />Inte nog med att dom har svindyra priser på sina produkter<br />dom har mutat in en alldeles förstor del av marknaden med<br />sitt PDF format (visst PDF är en öppen specifikation, eller<br />till och med en öppen standard, vad vet jag. Och sure bellman<br />det funkar säkert skitbra inom trycke industrin med väl<br />inkörda rutiner kring det formatet)<br /><br />Men har du prövat att läsa en PDF på en PalmPilot någon gång?<br /><br />Inte nog med att man måste konvertera skiten innan man dunkar upp<br />den (vilket tar otroligt lång tid att göra om PDF-filen är något<br />längre). När man väl laddat upp skiten tar det 200 år (ingen överdrift<br />jag har mätt) att öppna varje sida. 200 år!!!<br />Mao skiten är oanvändbar.<br /><br />Just läsa dokument på en Palm är imo en av dom stora fördelarna.<br />Du kan ha med dig ett helt (mindre) biblotek (om det är pdf blir det<br />ännu mindre) på ett SD-kort, dvs läsning för hela semestern, i en<br />liten hand-moj. Du kan till och med ta med dig ett par långfilmer.<br /><br />Men om du tänker ta med dig PDF får du ladda upp ditt tåla mod.<br />Och när du ändå håller på ladda upp lite för mig med, jag<br />tänker inte göra det!!<br /><br />"Now where did I put that shotgun?"<br /><br />/Yours 'psychotic bastard' truly<br /><br /><br />Base Ad:<br />http://basecamphq.com/?referrer=colliberty<br />If your not already using it, start us it NOW.<br />(and remember to say colliberty when you join up :-)<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18720971-114795858243960234?l=you-own-that.blogspot.com'/></div>Johan Carlssonhttp://www.blogger.com/profile/15834022591521598070noreply@blogger.com0tag:blogger.com,1999:blog-18720971.post-1141648819832743022006-03-06T04:32:00.000-08:002006-03-11T14:18:56.040-08:00Thing I really hate (today)Java applets on websites!<br /><br />Adobe software, and specially PDFs, but the rest of their shit such pretty much too.<br />(So why can't I find a replacement for Indesign or Photoshop for instance, haven't got a clue?)<br /><br />Flash IDE environment, it's not programming, it's something else.<br /><br />I think I hate Java Applets (pretty much all about Java I hate) and Adobe more than I dislike Microsoft. Microsoft maybe striving for monopoly but hey if they are successful it's only because the other guys wasn't good enough. Microsoft product have had a not always bad reputation, some of the stuff they do is accually quite good in comparison.<br /><br />Things I'm considering switching to Apple and MacOSX though. I'm willing to try it anyway.<br />Linux on the desktop, haven't been convinced so far.<br /><br />Oh yeah, I almost forgot.<br />Using webbapplications instead of REAL applications, SUCKS!<br />The reason is that webbrowsers do not deliver the stability that you expect from a modern OS.<br />E.g. your browser may crash, because your doing several thing at the same time (as you DO) and one of the things you do is loading PDF file, which crashes the whole fucking thing.<br />Ok, you could run two different instances of the webbrowser (at least with IE) and if one crashes it only crashes that instance, but when you dont have tab-browsing and if your supposted to keep all things seperat you would consume allot of resources of each instance (because you DO have allot of browser windows going).<br />And also, the point oyu remember to create the browser in seperate instance is always right after it crashes.<br /><br />No, ajax webapps are the same thing throwing yourself back in to Windows 95 or MacOS 9, is that really what you want! I suggest you thing about that for a while before going the Ajax route for your next application.<br /><br />This said it doesn't mean that Ajax is bad for webapps (they already have this problems anyway), just dont try to replace REAL applications with webapps just because Ajax make it look and feel like one.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18720971-114164881983274302?l=you-own-that.blogspot.com'/></div>Johan Carlssonhttp://www.blogger.com/profile/15834022591521598070noreply@blogger.com0tag:blogger.com,1999:blog-18720971.post-1140166156764077662006-02-17T00:48:00.000-08:002006-02-17T00:49:16.773-08:00Johari Me<a href="http://kevan.org/johari?name=JohanC">http://kevan.org/johari?name=JohanC</a><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18720971-114016615676407766?l=you-own-that.blogspot.com'/></div>Johan Carlssonhttp://www.blogger.com/profile/15834022591521598070noreply@blogger.com0tag:blogger.com,1999:blog-18720971.post-1140089184546434682006-02-16T03:14:00.000-08:002006-02-16T03:26:25.236-08:00Something I tried too avoid...I always been a strong Zope advocate, but I find myself willing to step of the band-wagon because Zope isn't developing in the direction that I like. It's starting to become something that I was trying to avoid when I "joined up" (that would be J2EE like mastodont frameworks).<br /><br />As you might have notice I'm not a big fan of Zope 3, and I see Zope 3 (and CMF) as technologies that are blocking Zope from evolving into that I would like to have.<br />Also the key feature of Zope, the Object Database (ZODB) is starting to get in the way, it just hasn't evolved enough to battle the competition from the rising of the ORMs.<br /><br />The main benefit of having an transparent object database in the bottom is that persistent isn't an issue, it's handled automatically. Well you get that with an ORM too, and you don't have to rely on the database to handle version, your don't get a rigid object hierarchy (in fact you can have high dimensional object hierarchies if you'd like), you have index and fast query facilities from scratch without having to define your model twice (once for the objects and once for the ZCatalog).<br /><br />Conclusion, Zope was great when it came, it was new it was object-originated, it was dynamic typing and dynamic data models, it was fresh.<br /><br />Now it grown out of proportion and does seem to keep up, it's heavy, it's a dinosaur.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18720971-114008918454643468?l=you-own-that.blogspot.com'/></div>Johan Carlssonhttp://www.blogger.com/profile/15834022591521598070noreply@blogger.com0tag:blogger.com,1999:blog-18720971.post-1140087496905808692006-02-16T02:43:00.000-08:002006-02-16T02:58:16.926-08:00Flexibility vs. ProductivityI've always been a fan of flexibility in the framework, it's something that attracted me with the Zope framework from the beginning (you could add a property to any object at any time without having to change your application model, the AM was in a sense real-time changeable.<br /><br />Again quoting <a href="http://www.loudthinking.com/">David Heinemeier Hansson</a>:<br /><br />"I often find I want to trade flexibility for productivity. i am fine with saying, I could just do it this way, or I could do it 10 times faster."<br /><br />Now, David isn't just good looking and smart, he's "hyper cool".<br /><br />I find that I now days also want to trade flexibility for productivity. I don't have the time configuring Zope 3 apps, I just want the damn thing on the net with a minimums of effort.<br /><br />Ok, so I'm starting to compare Zope 3 and Rails. Not have had a particularly close look at Rails (yet) I'm starting to get the feeling that both Zope 3 and Rails try to do aspect-originated stuff.<br />The main difference is that Rails stay true to the philosophy of the language (Ruby) where Zope 3 stray of into different non Pythonic creations, adding the flexibility but with the cost of bad usablility. Rails stray for beauty in code, and I believe code is the best way to make programs, not configurations (which Zope 3 relies on heavily).<br /><br />For where I am now Rails seems to lack the co-location problems (which IMO is one of the largest problems with Zope 3). Rails also seems more true to the MCV pattern, even though Zope 3 has that pattern, it's not very well constituted to the user (calling controllers view classes for instance, it's just confusing).<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18720971-114008749690580869?l=you-own-that.blogspot.com'/></div>Johan Carlssonhttp://www.blogger.com/profile/15834022591521598070noreply@blogger.com0tag:blogger.com,1999:blog-18720971.post-1140078086276225642006-02-16T00:18:00.000-08:002006-02-16T00:21:26.276-08:00Ruby on rails Partials!!!We do it right (when Zope doesn't).<br />Ruby on rrails have partial which are sub-template that ar like includes but like subrutins at the sametime, os you can pass arguments.<br /><br />Well, that just kicks TAL macros in the ...<br /><br />I rebember how surpriced I was when I realized that METALs didn't compile to "module like" objects ith sub-routines. Haven't use TAL since then (the system I made was just over complicated and ugle, and no I didn't put business logic in the templates).<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18720971-114007808627622564?l=you-own-that.blogspot.com'/></div>Johan Carlssonhttp://www.blogger.com/profile/15834022591521598070noreply@blogger.com0tag:blogger.com,1999:blog-18720971.post-1140077735637741432006-02-16T00:14:00.000-08:002006-02-16T00:22:19.700-08:00More excellent quote from the creator of <a href="http://rubyonrails.com/">Ruby on Rails framework</a> <a href="http://www.loudthinking.com/">David Heinemeier Hansson</a>:<br /><br />"... because javascript is, what's the word, Horrible!"<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18720971-114007773563774143?l=you-own-that.blogspot.com'/></div>Johan Carlssonhttp://www.blogger.com/profile/15834022591521598070noreply@blogger.com0tag:blogger.com,1999:blog-18720971.post-1140076926811126432006-02-15T23:51:00.000-08:002006-02-16T03:28:29.043-08:00Finally someone that can "think"!!!"I like Ruby so much I want to use Ruby everywhere (in Ruby-on-rails), in the model, in the controllers, in the confituation, and in the VIEWS.<br />And now some of you who has been burned badly before by using a real programing language in the templates are screeming "NOOOO, you can not do this. If you do that the end of the world is coming, people will flood their views with logic and conditions, and it will be a mess and you never recover."<br />Ah, No! Because there is no such thing as taking the logic out of the view. The view will always have logic, it will always have loops it will always have conditions. You just call them something else if that make you feel good. your still putting logic in the view, and the key realization is that that's not a bad thing. Logic belong in view because we are making dynamic web applications not just this static things. So logic in views good!" -- <a href="http://www.loudthinking.com/">David Heinemeier Hansson</a>, creator of <a href="http://rubyonrails.com/">Ruby on Rails framework</a> (freely quoted by me :-)<br />Told ya!<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18720971-114007692681112643?l=you-own-that.blogspot.com'/></div>Johan Carlssonhttp://www.blogger.com/profile/15834022591521598070noreply@blogger.com0tag:blogger.com,1999:blog-18720971.post-1137943020482188762006-01-22T06:47:00.000-08:002006-01-22T07:17:00.620-08:00All Go for Django...I'm most probably gonne use Django for my little project.<br />I need a framework that I don't have to fight but still provides me with an efficient tool to make things fast.<br /><br />My initial assuption that Django would get in my way have been shattered enough to make me put my hopes in Django. Another reason is that I don't have time or want to search any more, I want to start prototyping.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18720971-113794302048218876?l=you-own-that.blogspot.com'/></div>Johan Carlssonhttp://www.blogger.com/profile/15834022591521598070noreply@blogger.com0tag:blogger.com,1999:blog-18720971.post-1137926345246858092006-01-22T02:26:00.000-08:002006-01-22T02:39:05.263-08:00I think an apology might be in placeI must admit I didn't give Django a fair examination, now that I have visited it I am much more happy about it. As I mention before it does what I want but not in a fasion I like.<br /><br />Well, the easy of making applikations with Django have convinced me that running<br />setup commands to get started isn't that bad after all.<br /><br />I'm suspecting I will run into limitations of Django but reading the tutorial was really fun.<br />Allot of stuff is made for you automatically.<br /><br />I think I'll keep reviewing this for a while.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18720971-113792634524685809?l=you-own-that.blogspot.com'/></div>Johan Carlssonhttp://www.blogger.com/profile/15834022591521598070noreply@blogger.com0tag:blogger.com,1999:blog-18720971.post-1137664896452916102006-01-19T01:32:00.000-08:002006-01-19T02:01:36.726-08:00"Google"The number one top ten of stupid answer a person could give another person asking a question on a online-forum or mailing-list is "Google", even so the answer is give more often when answers that actually help people.<br /><br />The main reason for people not realizing how stupid they behave is they fail to recognize that people are different and that a large amount of people isn't like them.<br />Correction, they know that people are different and that people are not like them, but instead of trying to understand how they work and accept them as they are they incorrectly judge these people as being stupid.<br /><br /><span style="font-style: italic;"><blockquote>"Repeat after me three times: Being different or thinking different isn't the same as being stupid."</blockquote></span><br /><br />Many people that ask questions on online-forum prefer to use relational methods for gathering information and are rather taught fact by someone in person than seeking it in solitude.<br />You could say that their information function is relation based or extrovert, compared to "the rational person" who's function is introvert and maybe more goal oriented (short term closure).<br /><br /><span style="font-weight: bold;font-size:130%;" >A false sense of all mighty knowledge</span><br />For "the rational person" the difference in knowing fact and knowing how to get facts are now days getting kind of blurred, and (of course) I blame the Internet and in particular Google ;-)<br />This is a contributing factor in the "Google" answer on online questions because the "know-it-all" person knows he could use Google to find the answer, hence he has a feeling of knowing the answer and then feels entitled to actually answer it (with "Google"). When in fact he didn't have the answer or worse he did but didn't put an afford in formulating an answer him self (because it's easier and "everybody should be tough to do thing my way").<br /><br />This will not end, but as with the Swedish language protectionists at "skrivihop.nu", "rational people" can learn new behaviour, the problem is no one have told them, until now.<br />Well some rational people doesn't want to change there behaviour, but the rest of us have already learned to ignore them :-)<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18720971-113766489645291610?l=you-own-that.blogspot.com'/></div>Johan Carlssonhttp://www.blogger.com/profile/15834022591521598070noreply@blogger.com0tag:blogger.com,1999:blog-18720971.post-1137596604872585192006-01-18T06:59:00.000-08:002006-01-18T07:04:38.223-08:00Cocktail party problem<a href="http://www.cis.hut.fi/projects/ica/cocktail/cocktail_en.cgi">Cocktail party problem</a> or as I used to call it when I when to the university, the cocktail problem. It turned out to be a completely different problem though.<br /><br />Anyway this is a really cool example on how to use the SOM-neural network to separate two sound sources. Accually the example works so well I'm starting to think they are faking it.<br />I might also have missed something very important, being a 1200CC chaos machine and all.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18720971-113759660487258519?l=you-own-that.blogspot.com'/></div>Johan Carlssonhttp://www.blogger.com/profile/15834022591521598070noreply@blogger.com0tag:blogger.com,1999:blog-18720971.post-1137492973672330932006-01-17T02:11:00.000-08:002006-01-17T13:41:49.423-08:00There is just too much stuff out thereAfter spending some time researching different web app. solutions in Python (while trying to avoid treason by looking at Rails directly ;-) I'm over whelmed. There is just too much project going on.<br />I guess doing rdb based web apps in python is in fashion *lol*<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18720971-113749297367233093?l=you-own-that.blogspot.com'/></div>Johan Carlssonhttp://www.blogger.com/profile/15834022591521598070noreply@blogger.com0tag:blogger.com,1999:blog-18720971.post-1137492446791553562006-01-17T01:51:00.000-08:002006-01-17T02:07:26.916-08:00TurboGear: Same same different different<a href="http://www.turbogears.org/">TurboGear</a> is really just some other stuff pack together to a package, it might accually be pretty brilliant.<br /><br />TurboGear combineds <a href="http://www.mochikit.com/">MochiKit </a>(Javascript libarary), <a href="http://kid.lesscode.org/">Kid </a>(TAL and XSLT inspired XML template language), <a href="http://www.cherrypy.org/">CherryPy</a> (web app. framework) and <a href="http://sqlobject.org/">SQLObject</a> (ORM). It also uses <a href="http://effbot.org/zone/element-index.htm">ElementTree</a> (Fredrik Lunds XML library), <a href="http://formencode.org/">FormEncode</a> (form validation framework), <a href="http://www.turbogears.org/testgears/">TestGears</a> (unit-test) , and <a href="http://json-py.sourceforge.net/">json-py</a> (json-python bridge).<br /><br />Accually this are all software that sound amazingly interesting and those I haven't check out (and approved like SQLObject, which imo is the best Python ORM out there, and CherryPy, which imo is the best simple web app. framework out there even though I'm still looking.<br /><br />Kit is a possiblity, I will either choose Kit or TAL I guess, it all depends if Kit does what TAL doesn't do for me, e.g. let me define a component library of visual components (not macros).<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18720971-113749244679155356?l=you-own-that.blogspot.com'/></div>Johan Carlssonhttp://www.blogger.com/profile/15834022591521598070noreply@blogger.com0tag:blogger.com,1999:blog-18720971.post-1137491442501633302006-01-17T01:47:00.000-08:002006-01-17T14:37:31.053-08:00No go for DjangoI'm pretty sure <a href="http://www.djangoproject.com/">Django</a> is what I want, or should I say Django does what I want to do, but I'm pretty sure I don't want Django to "tell" me how to do it.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18720971-113749144250163330?l=you-own-that.blogspot.com'/></div>Johan Carlssonhttp://www.blogger.com/profile/15834022591521598070noreply@blogger.com3tag:blogger.com,1999:blog-18720971.post-1137431758860498252006-01-16T09:04:00.000-08:002006-01-16T09:15:58.953-08:00Cheetah TemplateCherryPy got an bonus tutorial but it required <a href="http://www.cheetahtemplate.org/">Cheetah Template</a> too run so I had to get that and check it out.<br /><br />Well they are claming to "encourages clean separation of content, graphic design, and program code", but I can't for the world see how. It's basically Python Classes written in HTML.<br /><br />One thing that made me interested was the fact that you could inherite a template from a sub-template. But after a time of thinking I recall why this is a bad idea. The one thing I hat the most in TAL is METAL, the macro language in TAL. METAL lets you reuse snippets defined in other template (METAL templates).<br /><br />Well the bad thing about this is (part from the METAL implementation being unintuitive to a Python programmer because snippets are included not callable which would have made it possible to give arguments to a snippet).<br />Ok the bad thing (again) is co-location and co-location leads to unmanagable code, if you don't believe me check out Plone and try to change the site design.<br /><br />I want to have a template language that uses layers instead of inheritance, that's how I work now days. E.g. I create a top layer template, it calls a set of renderNextLayer methods (usually just on called renderContent, more complex designs then that is accutally very rare).<br />When I call the top layer template I give it the renderContent callable as an argument.<br />Off couse this method works in all template languages that allow you to supply variable names including <a href="http://www.cheetahtemplate.org/">Cheetah</a>.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18720971-113743175886049825?l=you-own-that.blogspot.com'/></div>Johan Carlssonhttp://www.blogger.com/profile/15834022591521598070noreply@blogger.com0tag:blogger.com,1999:blog-18720971.post-1137431001801318932006-01-16T09:00:00.000-08:002006-01-16T09:03:21.803-08:00Simple but slow cherryOne of the things that stand-out when acctually running CherryPy is that it's remarkably slow. For a single use with the most simples Hello World it take almost secs to return a page, I would have expected a simple web app. framework to be faster, even the monolit Zope is much faster (not starting up though but with few Products installed that ain't that slow either).<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18720971-113743100180131893?l=you-own-that.blogspot.com'/></div>Johan Carlssonhttp://www.blogger.com/profile/15834022591521598070noreply@blogger.com0tag:blogger.com,1999:blog-18720971.post-1137430836577058492006-01-16T08:59:00.000-08:002006-01-16T09:00:36.593-08:00WebwareWell I checked out Webware for 5 minutes, and I can only say that I don't have reason for evaluating futher. If I should use a complex framework I would use Zope 3.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18720971-113743083657705849?l=you-own-that.blogspot.com'/></div>Johan Carlssonhttp://www.blogger.com/profile/15834022591521598070noreply@blogger.com0tag:blogger.com,1999:blog-18720971.post-1137425716771803492006-01-16T07:31:00.001-08:002006-01-16T07:47:00.450-08:00Yield your self<h1>Fantastic!</h1><br /><br /><p>I just tried the tutorial example #09 in the CherryPy distribution and that's all about generators. Namely you can public a generator factory, using yield to return bits and pieces of the page with out bothering to append the data in a temp variable.</p><br /><br /><p>How cool is that (well a little bit, a tiny-iny bit, oh sod of).</p><br /><br /><p>Here's the example:</p><br /><br /><blockquote><pre><code>"""<br />Bonus Tutorial: Using generators to return result bodies<br /><br />Instead of returning a complete result string, you <br />can use the yield statement to return one result part <br />after another. This may be convenient in situations <br />where using a template package like CherryPy or Cheetah<br />would be overkill, and messy string concatenation too <br />uncool. ;-)<br />"""<br /><br />import cherrypy<br /><br /><br />class GeneratorDemo:<br /> <br /> def header(self):<br /> return "&lt;html>&lt;body>&lt;h2>Generators rule!&lt;/h2>"<br /> <br /> def footer(self):<br /> return "&lt;/body>&lt;/html>"<br /> <br /> def index(self):<br /> # Let's make up a list of users for presentation purposes<br /> users = ['Remi', 'Carlos', 'Hendrik', 'Lorenzo Lamas']<br /> <br /> # Every yield line adds one part to the total result body.<br /> yield self.header()<br /> yield "&lt;h3>List of users:&lt;/h3>"<br /> <br /> for user in users:<br /> yield "%s<br/>" % user<br /> <br /> yield self.footer()<br /> index.exposed = True<br /><br />cherrypy.root = GeneratorDemo()<br /><br /><br />if __name__ == '__main__':<br /> cherrypy.config.update(file = 'tutorial.conf')<br /> cherrypy.server.start()<br /><br /></code></pre></blockquote><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18720971-113742571677180349?l=you-own-that.blogspot.com'/></div>Johan Carlssonhttp://www.blogger.com/profile/15834022591521598070noreply@blogger.com0tag:blogger.com,1999:blog-18720971.post-1137402548124991942006-01-16T00:41:00.000-08:002006-01-16T01:21:59.316-08:00Jag har varit otrogen...Jag har dom senaste 5 åren jobbat med ett ramverk för webbapplikationer om heter Zope, det är ett komplext och kompetent system med många fiffiga finesser och allt man behöver är inkluderat (webbserver, scriptspråk, transkationsserver, databas, säkerhet med mera).<br /><br />På senare tid har en ny generation (den tredje generationen) Zope 3 av Zope växt fram och efter att ha bråkat med Zope 3 större del av hösten kan jag nu lägga den på hylla (eftersom uppdraget är där Zope 3 användes är slut).<br /><br />Men det goda i det hela är att jag börjat omvärdera hur lämpligt Zope är för att lösa alla tänkbara problem. Även om jag fortfarande anser att Zope är extremt lämpligt för webbpubliceringsapplikationer som CMS, e-handel, Intranet och portaler är det inte alltid det bästa verktyget för jobbet. Faktum är att jag många gånger misslyckats med Zope, egentligen lika många gånger som jag lyckats.<br /><br />Zope 3 är visserligen mycket renare än in föregångare (Zope 2) och det innebär att det både<br />är enklare att lyfta in externa lösningar in i Zope 3 och att Zope 3's komponenter enklare<br />kan återanvändas utanför Zope 3. Men Zope 3 dikterar fortfarande, och kanske till och med<br />i större utsträckning än Zope 2, hur man skall designa sin webbapplikationer.<br /><br />Enter CherryPy (vilket är den första i en trolig rad av Python baserade webbapplikationer ramverk som jag nu kommer att titta på för ett framtida spel projekt).<br /><br />CherryPy har inte hälften av alla bells&whistles som Zope plattformen erbjuder, det mest<br />signifikanta är troligen avsaknaden av säkerhetssystem men det är en enkelt och strait forvard sätta att bygga webbapplikationer.<br /><br />Enkelt beskriver kan man säga att man skapar klasser som man sedan instantierar och till delar<br />till en objekthierarki med start i cherrypy.root. Objekten metoder kan publicerar till webben genom antingen en dekorator eller att man tilldelar variabeln published=True på "metoden" (man kan göra sånt i Python eftersom funktioner och metoder är objekt).<br /><br />Tre metoder kan användas som "default" metod, index(*arg, **kw), default(*arg, *kw), och __call__.<br />Det normala är att använda index eller default där index har företräde framför default.<br />Skillnaden mellan dom båda är att argumenten för index fås från webb requesten, medan argumenten för default är en kombination av webb request variabler och ej matchade URL element.<br /><br />Exempel:<br /><br /><span style="font-family: courier new;"><span style="font-weight: bold;">URL Anrop</span></span><br /><span style="font-size:85%;"><span style="font-family: courier new;">/ root.index()</span><br /><span style="font-family: courier new;">/?hello=world root.index(**kw={'hello':'world'})</span><br /><span style="font-family: courier new;">/hello/kitten root.default(*arg=('hello', kitten')</span><br /><span style="font-family: courier new;">/hello/kitten?hello=world root.default(*arg=('hello', kitten', **kw={'hello':'world'})</span></span><br /><br /><br />Hänger du med, läs CherryPys tutorial, dom förklarar det bättre.<br /><br />CherryPy saknar skriptspråk eller snarare är skriptspråk agnostisk, vilket passar mig fin fint eftersom jag troligen vill skapa mitt eget skriptspråk (en variant av Zopes TAL språk).<br /><br />CherryPy erbjuder inte så mycket mer, en inbyggd webserver som inte verkar speciellt imponerande, en filter funktion för att patcha in låg nivå hantering av request och response, en väldigt medioker konfigurerings funktion baserat på Pythons inbyggda .ini parser (men den räcker till väldigt bra för mina mål, man kan jämföra den med Zope3s mastodont konfigureringsspråk).<br /><br />En sak jag är glad att CherryPy har out-of-the-box är sessions hantering, den är naturligtvis inte lika komplicerad som Zopes (duh!) men räcker troligen till för att hålla en cache av session<br />data för en användare.<br /><br />Som jag nämde ovan saknar CherryPy ett system för säkerhet, visserligen har dom ett system för att publicera objekt och metoder (default är att metoder inte är accessbara från webben) men det finns inget system att hantera användare/grupper och inget system för rättigheter/roller.<br /><br />Om jag väljer att gå vidare med CherryPy är det första jag kommer försöka göra att integrera<br />Zope 3's zope.security med CherryPy så jag kan definera åtkomsträttigheter.<br /><br />Nästa ramverk för granskning blir django...<br />Vi hörs!<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18720971-113740254812499194?l=you-own-that.blogspot.com'/></div>Johan Carlssonhttp://www.blogger.com/profile/15834022591521598070noreply@blogger.com0tag:blogger.com,1999:blog-18720971.post-1137101165572937412006-01-12T13:12:00.000-08:002006-01-13T02:09:23.753-08:00SQLObject och Zope3 security(Jag kanske borde ha en teknik blogg istället för att maila er stupikvarten!)<br /><br /><span style="font-weight: bold;font-size:180%;" >Så jag skrev det på i min blogg istället.</span><br /><br />I alla fall, mitt äventyr med SQLObject går vidare. Nästa steg i problematiken är att förse dom stackars objekten med en vettig säkerhets modell.<br /><br /> Enter Zope3. Detta är redan gjorts <a href="http://codespeak.net/z3/sqlos/">SQLOS</a> projektet, men eftersom jag inte vill använda <a href="http://www.zope.org/DevHome/Wikis/DevSite/Projects/ComponentArchitecture/FrontPage">Zope3</a> som det är och absolute inte vill använda mig av <span style="font-style: italic;">"Containers"</span> i ZODB<br />för att husera object (jag vill att dom skall få sväva fritt i sitt Python universum, eller något "slightly" mindre poetiskt). Så...<br /><br /> Så använder jag bara Zope3s zope.security, vilket pga av att zope3 är väldigt modulärat uppbyggt och har få dumheter (a la Acquisition<br />eller ExtensionClasses), är det super enkelt att återanvända<br />(eller, det är Zope3 så det är inte enkel men det är super gör-bart och efter att man skruvat fast huvudet igen, vilket har en tendens att lossna efter att man läst Zope3s dokumentation över hur saker funkar internt).<br /><br /> En annan liten down side med zope.security är att man faktiskt måste implementera "allting", men byggstenarna och de inre mekanismerna finns där och det är inte speciellt mycket som är allting när allt kommer omkring.<br /><br /> Ett annan litet problem är att zope.security implementerar isinstance eftersom isinstance i __builtins__ inte kan hantera objekt wrappade i en Proxy (naturligtvis). SQLObject verkar enligt utsago från skaparen av SQLOS alt SQLObject använda isinstance på flertal ställen vilket<br />innebär att jag måste antingen byta ut den i __builtins__ (aj), monkey patch in den i SQLObject eller helt enkelt patcha SQLObject (SQLOS monkey patchar tror jag, det kommer jag nog också göra).<br /><br /><br /> Ett annat plus med zope.security är att dom definerar om restricted python från zope 2 på ett återanvändbart sätt. Det man kan skapa med det är 1. säkra användar programmerbara objekt (till en moo), 2. en säker intrepetator (till samma moo).<br /><br /> Alltså man kan göra en säker pythonbaserad moo, all data kan hållas i en SQL server av ditt val (eller mitt, vilket troligen blir postgres kanske mysql) inklusive python kod objekt eftersom SQLObject har en pickle data type (dvs för dom databas back-ends som kan hantera blobar förstås).<br /><br /> Nu skall jag testa att använda eventnet för att skapa en enkel multi-user mud. Eventnet är en modul för en nätverksbaserad eventloop för spel som verkar lovande.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18720971-113710116557293741?l=you-own-that.blogspot.com'/></div>Johan Carlssonhttp://www.blogger.com/profile/15834022591521598070noreply@blogger.com1