Posts Tagged ‘blog’

I’m alive

Saturday, August 2nd, 2008

OK, I know it’s been almost a year since I updated this blog, but rest assured that I’m still alive and kicking. The observant among you will notice that the design of the blog has changed. The even more observant will notice that huge swaths of content are now missing. Things like my photo albums, my running log, old comments, and Kavi’s little site are now gone. They may make a reappearance someday, especially if I get prodded sufficiently. I have my old site running locally on my laptop, but I’m too lazy to bring it all back right now.

If you’re just interested in pics of Kavi (and I know that’s most of you), go visit my Picasa photo album.

Cathy Sarisky, who had so kindly hosted kurup.org for a few years now, has decided to exit the web hosting business. I took the opportunity to scale down my web operations a bit. This blog is now powered by WordPress instead of OpenACS. I’m hoping that “outsourcing” the tech stuff to WordPress will allow me to focus more on writing stuff, rather than tweaking settings. Hold me to it! I’ve stolen the design for this blog from diveintomark. I’ve always enjoyed his writing and his design sense. I hope he doesn’t mind.

So much has changed since my last post. Kavi has just continued to grow and amaze us. I know for a fact that he is the most adorable little boy in the universe. He’s gotten even more adorable now that he sleeps through the night (as of the past month!). We’ve moved into a house for the first time in our adult lives. We are now residents of Chapel Hill, NC. We’re living the American Dream. I’m going to skip right over the whole purchase process which was more nightmarish than it should have been thanks to some very difficult sellers. Since moving in, we’ve replaced a missing toilet tank, shampooed carpets, changed locks, and hired painters, landscapers, electricians, pest control people, gutter cleaners and house cleaners. Almost makes you want to move back into an apartment. :-)

I started work as a hospitalist last September, and I’m starting to get into a groove now. It was quite a shock to switch from outpatient, academic practice to inpatient, private practice. At times, I still feel like a resident, but for the most part, I find this job to be much more rewarding intellectually and spiritually. It’s more exhausting than I thought it would be, though. I can’t see myself working this kind of schedule for the rest of my life. So, as always, I’m still trying to figure out exactly what I want to do when I grow up.

Well, enough rambling for my first post back. Hope to speak to y’all soon (That’s the southerner in me now!)

Milla Blogs

Wednesday, August 2nd, 2006

Milla correctly points out that she is my blogging inspiration. Not just for telling me to blog more, but for providing the inspiration in the form of the most promising blog-start ever! My favorite so far:

I turned on 1010 Wins “you give us 20 minutes, we’ll give you traffic updates from yesterday for roads you don’t drive on” and heard nothing at all about the mudslide on the Saw Mill River Parkway, which turned my road home into a parking lot.

Someone put her on a reality show, already!

Prettier permalinks

Tuesday, March 28th, 2006

Permalink stands for ‘permanent link’. When you create a blog post, it gets added to the top of your blog, pushing older entries down. Eventually, posts get pushed off the front page, so it’s important that you have a way to refer to old blog posts. A permalink is the link that will always point to a specific post.

OpenACS (lars-blogger) permalinks look like this:

http://kurup.org/blog/one-entry?entry_id=58950

This works and it’s really easy to code, but it doesn’t give much information about the content or date of the post.

A lot of other blog packages use permalinks which look like this:

http://kurup.org/blog/2006/03/01/tag-cloud

It’s easy to tell how old the post is, and what it might be about. More importantly, it seems that search engines give URLs like this more weight. So, I’ve gone ahead and made the changes on my blog. Enjoy!

For the OpenACS geeks, here’s the changes that I made. It won’t necessarily apply cleanly against OpenACS, but it will give you an idea of what to change. It includes an automated test to assure you that both the old and new permalinks work.

Tag Cloud

Wednesday, March 1st, 2006

And now I have a pretty tag cloud on the side of my blog (that I pretty much stole from del.icio.us)

My blog is tagged

Monday, February 27th, 2006

I’m finally getting around to moving my blog into the Web 1.5 world. (2.0 minus javascript). I scrapped the categories system and created a super-simple tags package. So, now I can tag posts and technorati can find them. OpenACS barely lights up on technorati. Compare RubyOnRails (20 mentions per day) with OpenACS (1 mention in the past month!). I know Rails is popular, but is OpenACS completely dead? I don’t think so.

Creating a Blog Application using the OpenACS Content Repository

Thursday, February 16th, 2006

I created a very simple blog application using the OpenACS Content Repository (CR). When I say simple, I mean simple, probably to the point of being useless. I just wanted to try writing something as quickly as possible using the CR. Here’s a quick run-through of the code, in case it might help someone else understand how to use the CR. I’m not including much commentary; email me (or comment) if you’d like me to expound more.

blog.info

 <?xml version="1.0"?> <!-- Generated by the OpenACS Package Manager -->  <package key="blog" url="http://openacs.org/repository/apm/packages/blog" type="apm_application">     <package-name>Blog</package-name>     <pretty-plural>Blogs</pretty-plural>     <initial-install-p>f</initial-install-p>     <singleton-p>f</singleton-p>          <version name="0.1d" url="http://openacs.org/repository/download/apm/blog-0.1d.apm">         <owner url="mailto:admin@localhost">Admin User</owner>         <summary>A blog application.</summary>         <description format="text/html">A simple Blog application using the Content Repository.</description>         <maturity>0</maturity>          <provides url="blog" version="0.1d"/>         <requires url="acs-content-repository" version="5.2.2"/>          <callbacks>             <callback type="after-install"  proc="blog::apm::after_install"/>             <callback type="after-instantiate"  proc="blog::apm::after_instantiate"/>             <callback type="before-uninstantiate"  proc="blog::apm::before_uninstantiate"/>             <callback type="before-uninstall"  proc="blog::apm::before_uninstall"/>         </callbacks>         <parameters>         <!-- No version parameters -->         </parameters>      </version> </package>  

tcl/blog-apm-procs.tcl

 namespace eval blog::apm {}  ad_proc -private blog::apm::after_install {} {      Install the blog datamodel. } {     content::type::new -content_type blog_post \         -pretty_name "Blog Post" \         -pretty_plural "Blog Posts" \         -table_name "cr_blog_posts" \         -id_column "post_id" }  ad_proc -private blog::apm::after_instantiate {     -package_id } {     Setup one instance of a blog. Creates a content folder and associate     blog_posts with it. } {     set folder_id [content::folder::new \                        -name $package_id \                        -label "Blog Folder $package_id" \                        -package_id $package_id \                        -context_id $package_id]      content::folder::register_content_type \         -folder_id $folder_id \         -content_type "blog_post" \         -include_subtypes "t" }  ad_proc -private blog::apm::before_uninstantiate {     -package_id } {     Remove 1 instance of blog application. } {     set folder_id [blog::folder_id $package_id]     content::folder::delete -folder_id $folder_id -cascade_p t     content::type::delete -content_type blog_post \         -drop_children_p t \         -drop_table_p t }  ad_proc -private blog::apm::before_uninstall {} {     Drop the application. } {     content::type::delete -content_type blog_post \         -drop_children_p t \         -drop_table_p t } 

tcl/blog-procs.tcl

 namespace eval blog {}  ad_proc -public blog::folder_id {package_id} {     Return the CR folder_id associated with this package_id      @param package_id Current package_id } {     return [db_string get_folder_id "select folder_id from cr_folders where package_id=:package_id"] } 

www/index.tcl

 ad_page_contract {      List posts      @author Vinod Kurup [vinod@kurup.com]      @creation-date Tue Feb 14 20:56:24 2006      @cvs-id $Id:$ } { }  set package_id [ad_conn package_id]  db_multirow posts posts "   select i.item_id,           r.title,          r.content,          to_char(o.creation_date,'YYYY-MM-DD HH24:MI:SS') as creation_date,          o.creation_user     from cr_blog_posts p, cr_items i, cr_revisions r, acs_objects o    where i.item_id=o.object_id      and p.post_id=r.revision_id      and o.package_id=:package_id       and i.live_revision=p.post_id    order by creation_date desc" 

www/index.adp

 <master>  <p><a href="post/ae">Add Post</a></p>  <multiple name="posts">   <include src="../lib/one-post"             item_id="@posts.item_id@"             title="@posts.title@"             content="@posts.content@"             creation_user="@posts.creation_user@"             creation_date="@posts.creation_date@" /> </multiple> 

www/post/ae.tcl

 ad_page_contract {      Add or edit a post      @author Vinod Kurup [vinod@kurup.com]      @creation-date Tue Feb 14 20:39:39 2006      @cvs-id $Id:$ } {     item_id:integer,optional }  set package_id [ad_conn package_id] set user_id [ad_conn user_id] set ip_addr [ad_conn peeraddr]  permission::require_permission -object_id $package_id -privilege write  set context [list "Add/Edit Post"]  ad_form -name add_post -form {     item_id:key(t_acs_object_id_seq)     title:text(text)     content:text(textarea) } -select_query {     select r.title, r.content        from cr_items i, cr_revisions r       where i.item_id=:item_id         and i.live_revision=r.revision_id } -edit_data {     content::revision::new -item_id $item_id \         -title $title \         -content $content \         -package_id $package_id \         -is_live t      ns_returnredirect .. } -new_data {     content::item::new -name "Post $item_id" \         -item_id $item_id \         -creation_user $user_id \         -text $content \         -package_id $package_id \         -parent_id [blog::folder_id $package_id] \         -creation_ip $ip_addr \         -content_type "blog_post" \         -title $title      ns_returnredirect .. } 

www/post/ae.adp

 <master> <property name="title">Add/Edit Post</property> <property name="context">@context;noquote@</property>  <formtemplate id="add_post"></formtemplate> 

www/post/del.tcl

 ad_page_contract {      Delete a post      @author Vinod Kurup [vinod@kurup.com]      @creation-date Tue Feb 14 22:49:11 2006      @cvs-id $Id:$ } {     item_id:integer }  permission::require_permission -object_id $item_id -privilege write  content::item::delete -item_id $item_id  ns_returnredirect .. 

www/post/view.tcl

 ad_page_contract {      View one post      @author Vinod Kurup [vinod@kurup.com]      @creation-date Wed Feb 15 20:24:32 2006      @cvs-id $Id:$ } {     item_id:integer }  set package_id [ad_conn package_id] set package_url [ad_conn package_url]  db_0or1row post " select i.item_id,         r.title,        r.content,        to_char(o.creation_date,'YYYY-MM-DD HH24:MI:SS') as creation_date,        o.creation_user   from cr_blog_posts p, cr_items i, cr_revisions r, acs_objects o  where i.item_id=o.object_id    and p.post_id=r.revision_id    and o.package_id=:package_id     and i.live_revision=p.post_id    and i.item_id=:item_id"   set context [list $title] 

www/post/view.adp

 <master> <property name="context">@context;noquote@</property> <property name="title">@title@</property>  <include src="../../lib/one-post"           item_id="@item_id@"           title="@title@"           content="@content@"           creation_user="@creation_user@"           creation_date="@creation_date@" /> 

lib/one-post.tcl

 set package_url [ad_conn package_url]  set now [clock format [clock seconds] -format "%Y-%m-%d %H:%M:%S"]  set creation_date_pretty [util::age_pretty \                               -timestamp_ansi $creation_date \                               -sysdate_ansi $now]  set author [acs_community_member_link -user_id $creation_user] set write_p [permission::permission_p -object_id $item_id -privilege write] set perm_url [export_vars -base "${package_url}post/view" {item_id}] 

lib/one-post.adp

 <div class="post">   <h2><a href="@perm_url@">@title@</a></h2>   <p class="byline">     Posted by @author;noquote@     <span class="date">@creation_date_pretty@</span>   </p>   <div class="content">     @content;noquote@   </div>   <p class="actions">     <if @write_p@>      <a href="@package_url@post/ae?item_id=@item_id@">Edit</a> |     <a href="@package_url@post/del?item_id=@item_id@">Delete</a>     </if>   </p> </div> 

Notes

You’ll notice that there are no SQL datamodel files. Since I’m using the CR, all of the datamodel is created by using the CR TCL API (specifically content::type::new). This package is subsite aware meaning you can install apps on multiple subsites and the data in each subsite will remain isolated from other subsites. It should uninstall itself cleanly since I’ve written callbacks for before-uninstantiate and before-uninstall.

Like I said, this is very simplistic. You can create, read, update and delete posts, but that’s about it. No commenting. No tags or categories. No RSS feeds. No search. But, since we’ve used the CR as our base, I think it would be very easy to extend the app to do all those things. I’m going to work on that, just for fun, of course. Thanks to Dave Bauer for writing the TCL interface to the CR and for writing the wiki package which made me see the light about the benefits of using the CR.

David T is Blogging!

Friday, January 6th, 2006

It’s taken quite a while, but my friend Dave has finally started blogging. You can read his mini-bio on our Wedding Party page. For more info about him, you’ll have to follow his blog. I’m hosting his site on my server and I’ve been too lazy to change the layout of his blog, so it may look eerily familiar at the moment.

Take the MIT blog survey

Tuesday, July 5th, 2005

Take the MIT Weblog Survey

[found on Joel's Blog]