Home
The Toolkit for Online Communities
12944 Community Members, 1 member online
Log In Register

OpenACS BlogArchive

OpenACS Home : OpenACS Blog : Archive : 2005 : June

Using group by feature of list builder

Something like this should do the trick

-groupby { values { "Day" { { groupby time_stamp } { orderby time_stamp,desc} } } }

The list is { groupby_name { { groupby column } { orderby column,order } } }

Add this to the query as any other filter with template::list::filter_where_clauses.

You can pass as many lists in to the values parameters of group by as columns you want to group on. If you add the listfilters tag to your ADP file, it will show the available grouping options as filters. Make sure you add groupby:optional in ad_page_contract.

Another trick is to hide the column when it is used to grouping. Just dynamically set the hide_p paramter for the list element that is in groupby.

12:05 PM, 10 Jun 2005 by Dave Bauer Permalink | Comments (0)

Replace annoying ^M characters in Emacs

To replace the annoying ^M characters you can search and replace. The following representation holds true:

^M = C-q C-m

Resulating in this sequence:

M-%
Query replace: C-q C-m with: C-q C-j

01:02 AM, 10 Jun 2005 by Malte Sussdorff Permalink | Comments (0)

del.icio.us [refresh.dk]

I just came accross this instruction about how del.icio.us allows you to keep a rolling collection of bookmarks and reuse them on your website by retrieving them back via RSS. Jeffrey Veen describes how to do this easily using another external tool, but, hey, you've got your on server and OpenACS − this quick tutorial by Steffen Tiedemann Christensen shows you how to add del.icio.us links to your OpenACS server using an adp include.

03:44 AM, 08 Jun 2005 by Ben Koot Permalink | Comments (4)

No need for daemontools on MacOS X Tiger

Again using Launchd in MacOS X Tiger you can do away with daemontools.

Just copy/paste the following into a file called org.openacs.OpenACS.plist.

################# COPY BELOW ###########################
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTD
s/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>Label</key>
        <string>org.openacs.OpenACS</string>
        <key>OnDemand</key>
        <false/>
        <key>ProgramArguments</key>
        <array>
            <string>/var/lib/aolserver/openacs/etc/daemontools/run</string>
        </array>
        <key>ServiceDescription</key>
        <string>OpenACS Service</string>
        <key>UserName</key>
        <string>ncarroll</string>
        <key>GroupName</key>
        <string>web</string>
    </dict>
</plist>
################# COPY ABOVE ###########################

Then use the command below to start up the service:

$sudo launchctl load /Library/LaunchDaemons/org.openacs.OpenACS.plist

And the command below to stop the service:

sudo launchctl unload /Library/LaunchDaemons/org.openacs.OpenACS.plist

Couldn't be simpler.

01:31 AM, 08 Jun 2005 by Nick Carroll Permalink | Comments (1)

PostgreSQL Launchd on Tiger

I just installed PostgreSQL on Mac OS X 10.4 Tiger, and found that the PostgreSQL StartupItem provided in the acs-core-docs no longer works.  Instead use Tiger's Launchd system, which is so much simpler than StartupItems in previous Mac OS X releases.

Creating a PostgreSQL Launchd file allows your system to start up postmaster when your Mac boots.

This tip shows you how to create this file.

Use a text editor such as emacs to create the PostgreSQL Launchd file:

$ emacs /Library/LaunchDaemons/org.postgresql.PostgreSQL.plist

Copy and paste the following into the file.

################# COPY BELOW ###########################
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>Label</key>
        <string>org.postgresql.PostgreSQL</string>
        <key>OnDemand</key>
        <false/>
        <key>ProgramArguments</key>
        <array>
            <string>/usr/local/pgsql/bin/pg_ctl</string>
            <string>-D</string>
            <string>/usr/local/pgsql/data</string>
            <string>-l</string>
            <string>/usr/local/pgsql/data/server.log</string>
            <string>start</string>
        </array>
        <key>ServiceDescription</key>
        <string>PostgreSQL Server</string>
        <key>UserName</key>
        <string>postgres</string>
        <key>GroupName</key>
        <string>web</string>
    </dict>
</plist>
################# COPY BELOW ###########################

Next reboot your Mac and check to see if postmaster started up.

Or you can try the following commands:

$ sudo launchctl load /Library/LaunchDaemons/org.postgresql.PostgreSQL.plist
$ sudo launchctl start org.postgresql.PostgreSQL

10:37 AM, 07 Jun 2005 by Nick Carroll Permalink | Comments (1)

Emac Tricks -- auto-logging your shell buffer

I make silly mistakes when coding that I don't notice right away, and then a few days later I'll notice that something's not working as expected and it could take hours for me to figure out what's wrong. So...how do I save me from myself? Good question," says daveb, "Keep logs of what you do" (As in, backed up postgres. fixed bug 22. Installed photo-albem, and so on.) Even better, those who run a command-line through the emacs editor, can auto-log their shell buffers to file. After you enter shell-mode with "M-x shell" or "C-x C-m" or "C-x RET" or whatever (To see what the keyboard short-cut is on any of the command names, "M-x where-is"), the buffer is called "*shell*" and it has no file associated with it. All you have to do is write that buffer into a file that you pick and you'll have a complete log of what you did -- I usually save the file as ~/log/20050605_shell or something. Optionally, you can then rename the buffer back to "*shell*" (because writing to a file will automatically rename the buffer name to the file name.) To write a file, "M-x write-file" which is usually bound to "C-x C-w". To rename the buffer, "M-x rename-buffer". You need to make sure that your file is in auto-save-mode and that you have selected an appropriate value of auto-save-interval which is, I think, the number of key strokes between auto saves. I use 100.

09:28 AM, 06 Jun 2005 by Eric Wolfram Permalink | Comments (0)

Debugging trick

One thing I've done is create a script in my ~/bin directory called debug. The contents are simply:

tail -f /path/to/aolserver-error.log |grep "--"

Then while I'm working on OpenACS, I use ns_log Notice "--myvar: $myvar" to see pseudo-breakpoints in the code.

05:14 PM, 04 Jun 2005 by Jade Rubick Permalink | Comments (0)

XML

Archive

June 2005
S M T W T F S
      4 
6  7  8  10  11 
12  13  14  15  16  17  18 
19  20  21  22  23  24  25 
26  27  28  29  30     
April 2007
March 2007
October 2006
March 2006
February 2006
January 2006
December 2005
November 2005
August 2005
July 2005
June 2005
May 2005

Notifications

You may request notification for OpenACS Blog.

Syndication Feed

XML

Recent Comments

  1. Silvio Ernesto: hola
  2. Martin v. Löwis: Cannot run pg_ctl from launchd
  3. Joan Miller: Something Interesting
  4. Hubert Erlmoser: trustpharma.com
  5. Hubert Erlmoser: TRUSTPHARMA
  6. Ben Koot: Selva
  7. LARRY SCOVEL: TRUST PHARMA
  8. Nick Carroll: Theme Selva
  9. Ben Koot: More enhancements
  10. Jane Perez: Trustpharma.com