Archive for February, 2005

More On MT and Dates

Interstingly, the code that I wrote about yesterday has some signficant issues with it. While it will work for a blog that assumes that all of its entries are events, using it in a situation where you have a category called events (meaning that you have other posts in the mix) means that it returns an unpredicitable number of results.

Using the same code to produce a single event listing (I wanted to display the most curent event in relation to todays date), I was getting zero results. It finally dawned on me that the [code][/code] was returning only one post, regardless of category. Instead of an ‘Events’ category entry, my code was handing me an ‘About’ category entry. Fortunately, this is fixable.

The fix of course would be to hack the plugin to allow this tag to support categories, but I was to lazy to do that. Instead, I grabbed a different plugin and did it up a different way.

First I installed the EntryList plugin

[code]

Next Up:
“>

#more”>Read More…

[/code]

Unfortunately, I didn’t find the documentation for this plugin exactly helpful. I banged my head for quite awhile until I figured out some probably obvious things:

  • MT doesn’t like to mix sorts- MTEntries days=”1″ will override MTEntries category=”Events”
  • ListEntries will support days and lastn
  • The key to all this is this tag: $MTEntryListInclude$ While the documentation actually has this wrong (it uses $MTEntryListIncludeAll$), once you get this tag in here, it’s possible to make this work. This tag is the listing of the output from the MTEntriesUse MTEntries category=”Events” to output all of the entries from the given category
  • Use MTEntryList to store this list of entries into $MTEntryListInclude$
  • Sort and display properly with: [code][/code]

  • Comments

    Future Events in MT

    Working on a events calendar for Black Sheep Books and I’m trying to do a display that grabs all posts in the future from todays date, but displays them from today forward.

    There doesn’t seem to be a way to do this in MT out of the box. So of course, with a little bit of plugin help, it can all be cleaned up.

    here’s the goods:

    [code]

    “>

    [/code]

    The plugin that this depends on is: DateTags This is a great plugin and can do lots of nifty stuff.

    I got the idea for doing this from here:
    Asterisk.
    While somebody posted close to the correct code, it seemes to me that the above code is more straightforward- well works for me anyway.

    For what it’s worth, the code generates this piece of html:

    Comments

    Who Remembers Summers?

    I find it somewhat strange that people are getting upset about Larry Summer’s recent statements about biology. Not that people shouldn’t be upset about what his remarkably stupid ideas about biology are, but rather, why don’t people remember that this guy has a legacy of jerk-dom that is both remarkable and deeply disturbing.

    Perhaps it’s the old short memory issue that people can’t remember back to 1992 when a memo of his while he was at the World Bank was leaked. “Just between you and me, shouldn’t the World Bank be encouraging MORE migration of the dirty industries to the LDCs [Less Developed Countries]?”

    Ironically, the complete memo is worse

    DATE: December 12, 1991
    TO: Distribution
    FR: Lawrence H. Summers
    Subject: GEP

    ‘Dirty’ Industries: Just between you and me, shouldn’t the World Bank be encouraging MORE migration of the dirty industries to the LDCs [Less Developed Countries]? I can think of three reasons:

    1) The measurements of the costs of health impairing pollution depends on the foregone earnings from increased morbidity and mortality. From this point of view a given amount of health impairing pollution should be done in the country with the lowest cost, which will be the country with the lowest wages. I think the economic logic behind dumping a load of toxic waste in the lowest wage country is impeccable and we should face up to that.

    2) The costs of pollution are likely to be non-linear as the initial increments of pollution probably have very low cost. I’ve always though that under-populated countries in Africa are vastly UNDER-polluted, their air quality is probably vastly inefficiently low compared to Los Angeles or Mexico City. Only the lamentable facts that so much pollution is generated by non-tradable industries (transport, electrical generation) and that the unit transport costs of solid waste are so high prevent world welfare enhancing trade in air pollution and waste.

    3) The demand for a clean environment for aesthetic and health reasons is likely to have very high income elasticity. The concern over an agent that causes a one in a million change in the odds of prostrate cancer is obviously going to be much higher in a country where people survive to get prostrate cancer than in a country where under 5 mortality is is 200 per thousand. Also, much of the concern over industrial atmosphere discharge is about visibility impairing particulates. These discharges may have very little direct health impact. Clearly trade in goods that embody aesthetic pollution concerns could be welfare enhancing. While production is mobile the consumption of pretty air is a non-tradable.

    The problem with the arguments against all of these proposals for more pollution in LDCs (intrinsic rights to certain goods, moral reasons, social concerns, lack of adequate markets, etc.) could be turned around and used more or less effectively against every Bank proposal for liberalization.

    Borrowed from Counter Punch

    Comments (1)

    Ripping CDs In Ubuntu’s KDE

    In switching over from Mandrake, one of the things that I’ve been missing the most is ripping cd’s on the desktop to mp3. After upgrading to Hoary, this is actually pretty easy. Yes, I know that I could just rip to ogg format, but many mp3 players (ahem) don’t support it. So mp3 is the desired goal.

    KDE allows you to rip audio cds on the fly with a variety of formats. Here you can see the various choices. Sonny Rollins happens to be in my cd drive at this moment. And yes, I did by that cd. Thank you. You can configure how it rips in the control center:

    After upgrading your apt-get sources and running apt-get update, upgrade, logging in and out, every thing works great. Obviously, you’ll need to download KDE from the Ubuntu universe and you’re going to need multiverse as well. Here’s my apt-get sources file (/etc/apt/sources.list):

    # deb cdrom:[Ubuntu 4.10 _Warty Warthog_ - Preview i386 Binary-1 (20041020)]/ unstable main restricted

    deb http://archive.ubuntu.com/ubuntu/ hoary main restricted
    deb-src http://archive.ubuntu.com/ubuntu/ hoary main restricted

    ## Uncomment the following two lines to add software from the ‘universe’
    ## repository.
    ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    ## team, and may not be under a free licence. Please satisfy yourself as to
    ## your rights to use the software. Also, please note that software in
    ## universe WILL NOT receive any review or updates from the Ubuntu security
    ## team.
    deb http://archive.ubuntu.com/ubuntu/ hoary universe
    deb-src http://archive.ubuntu.com/ubuntu/ hoary universe

    deb http://archive.ubuntu.com/ubuntu/ hoary multiverse

    deb http://security.ubuntu.com/ubuntu/ hoary-security main restricted
    deb-src http://security.ubuntu.com/ubuntu/ hoary-security main restricted

    One make sure that you’ve gotten the following packages in addition to KDE:

    lame
    liblame0
    lame-extras

    Comments

    Upgrading MT to MYSQL

    Micah and I have been dealing with the nastyness of MT trying to bring this up to a MYSQL backend so that it can be moved to another server. Here’s some tips:

    1) Make sure that you’ve got the latest DB schema in your schemas directory
    2) If you encouter the following error while running the mt-db2mysql.cgi, if you’re getting this error:

    Column ‘entry_author_id’ cannot be null

    Go into MT (after setting it back to use the Berkley DB) edit any entry, and replace the entry ID in the URL with the entry that it failed the import on. I had several of these.

    Comments

    Ubuntu with SATA and IDE

    If you’re installing Ubuntu on a machine with an IDE cdrom and an SATA hard drive, the following information will be extremely helpful.

    Stollen from here: https://bugzilla.ubuntu.com/show_bug.cgi?id=1440

    1. boot up installer as normal
    2. Choose Language
    3. Skip to tty2 by hitting alt-F2
    4. do:

    insmod /lib/modules/2.6.xxxxx/kernel/drivers/cdrom/cdrom.ko
    insmod /lib/modules/2.6.xxxxx/kernel/drivers/ide/ide-core.ko
    insmod /lib/modules/2.6.xxxxx/kernel/drivers/ide/ide-generic.ko
    insmod /lib/modules/2.6.xxxxx/kernel/drivers/ide/ide-cd.ko
    insmod /lib/modules/2.6.xxxxx/kernel/drivers/ideide-core.ko

    5. Return to tty1 by hitting alt-F1
    6. Continue as usual loading other modules after the above are in place.

    UPDATE The original post was wrong. The above is now correct. Unfortunately the info in that bug fix was not quite 100%

    Comments