Welcome to Deadbeef.com
Articles and tips on software from authored by Jeremy Bettis.

Search

XML Feed RSS

What is RSS?

Who's Online?

  • Guest Users: 9

Archives for: July 2006

07/31/06

Permalink 03:58:08 pm, by Jeremy Email , 60 words, 684 views   English (US)
Categories: Personal

My LinkedIn Page

I have a profile up at LinkedIn, which I am not sure if this is a good idea or not, but here it is.

There is one nice feature, where you can upload your contacts and it will tell you which people are already in LinkedIn, so that you don't have to spam all of your friends for no reason.

07/28/06

Permalink 08:46:50 pm, by Jeremy Email , 69 words, 1581 views   English (US)
Categories: Anti-Spam

Pronet SEO tips

The linked article is a really good list of tips on how to improve your search engine rankings.

I have implemented two of their simpler suggestions, changing the page titles to "Post title - Deadbeef.com" instead of the silly "Deadbeef.com - Post Detail: Post title". I also put in a 301 redirect for deadbeef.com to www.deadbeef.com.

We'll have to see if it makes any difference.

Permalink 07:05:13 pm, by Jeremy Email , 61 words, 1030 views   English (US)
Categories: Personal

The West Dodge Road expressway actually works!

I came home today on the new West Dodge Road Expressway here in Omaha, and it only took 11 minutes. This was at the peak of rush hour too. Normally this would take me over 20 minutes.

Other than being a big federal earmark ($80 million), it is turning out nice. It opened early, and has an immediate and positive impact on the traffic.

Permalink 03:54:08 pm, by Jeremy Email , 71 words, 694 views   English (US)
Categories: General, Personal

Microsoft gets into the medical record business

The linked article of note because both of the hospitals noted in the article are also using my software!

I wonder if any of the 42 people that used to work at Washington Hospical Center and now work for Microsoft have heard of my employer?

I had not heard of their product Azyxxi before this, but I would not be suprised if we are already sharing data with them via HL-7 messaging.

Permalink 01:39:00 pm, by Jeremy Email , 297 words, 3465 views   English (US)
Categories: Windows, .NET

Redirecting the output of a program to a file in .NET framework

It doesn't seem like this should be so hard, but it is. The Win32 CreateProcess API call has two nifty ways to do this.
1) Inherit handles from the parent process. So open the log file as your own stdout and stderr, then launch the child process.
2) Specify the stdout and stderr handles explicitly to the CreateProcess call.

Now, we all know that in .NET using win32 api calls is naughty, so let's try using System.Diagnosis.Process.Start() instead. It has a very convient methods for capturing the output, but no way to set the handles to a file. Rats.

So all we have left is a hack. Launch cmd.exe and have it redirect the output as described here: http://weblogs.asp.net/israelio/archive/2004/08/31/223447.aspx

Code:

ess.Start("cmd.exe", "/c foo.exe -arg >" + dumpDir + "\\foo_arg.txt 

icky :( Oh and wait, the process exits immediatly, and the Process.ExitCode is always 1. Arg!

Ok, so we need another hack. How about instead of starting cmd.exe we just run a bat file.

Code:

amWriter bat = File.CreateText("foo.bat"); 
bat.WriteLine("@echo off"); 
bat.WriteLine("foo.exe -arg >" + dumpDir + "\\foo_arg.txt"); 
bat.Close(); 
Process task = new Process(); 
task.StartInfo.UseShellExecute = false; 
task.StartInfo.FileName = "foo.bat"; 
task.StartInfo.Arguments = ""; 
task.Start(); 
task.WaitForExit 

Truly horrific, but it has the advantage of working! Of course this is subject to a race condition where foo.bat could be replaced with another file by a malicious process, and it's evil commands would be executed within our user context. I don't know how to fix that. Perhaps generate a random path name, create a directory, change the ACL's to prevent anyone from creating files in there, create the batch file in the directory, and then run it. Maybe.

Permalink 09:59:43 am, by Jeremy Email , 59 words, 551 views   English (US)
Categories: Personal

My wife has a blog now

My lovely wife Amy has set up her own blog along with a few of her friends at http://www.teachingwithjoy.com. It will cover her favorite topics which are homeschooling & teaching in general. Right now she has her list of book recommendations up, but expect to see some nifty lesson plans and activities in the near future.

07/27/06

Permalink 09:52:59 pm, by Jeremy Email , 117 words, 4684 views   English (US)
Categories: Anti-Spam, B2Evolution

Automatically remove invalid b2evolution users

If your web site is anything like mine, you have spammers registering as users in the hope that they will have their spammy comments show up.

Here is how you can get b2evolution 1.8 to automatically delete the users if they have not validated their email address within 7 days.

First, copy this file to .../blogs/inc/CONTROL/cron/

Then edit .../blogs/inc/CONTROL/cron/crontab.php and add in these records:

$cron_job_names:

'delete_users' => T_('Delete invalid users'),

$cron_job_params:

'delete_users' => array(
'ctrl' => 'cron/_delete_users.job.php',
'params' => NULL ),

Then go to the Scheduler page in the backoffice, and add a new job.

Now all your fake spam users will get autodeleted!

07/26/06

Permalink 03:40:51 pm, by Jeremy Email , 106 words, 1612 views   English (US)
Categories: General

"As per" is evil and should die

I was reminded again today about how much I dislike the phrase "as per". It is complete useless and unnecessary! I find that every usage could be expressed using either "as" or "per" or by leaving out the two words altogether.

I have tried to find some references on the web, as to the correctness of this idiom, but I have not had much luck. Please leave a comment if you know of a definitive source for the evilness of this phrase.

It's Evil:
Garbl's Style Manual (Who is Garbl? I have no idea)
HR Soapbox

Noncommital:
Dr Grammer

It's good:
52,000,000 web pages can't be wrong?

07/18/06

Permalink 01:35:31 pm, by Jeremy Email , 23 words, 796 views   English (US)
Categories: Security

Fake ID's Save Lives in Iraq

I saw this article linked from Bruce Schneier's Blog. I always prickle at having to show my ID so this caught my attention.

07/17/06

Permalink 07:55:46 pm, by Jeremy Email , 236 words, 1199 views   English (US)
Categories: B2Evolution

B2Evolution 1.8 released

The new version of b2evolution is out for download and I have moved over my blog.

Changes I had to make:

  • The skin changed a little bit, so I had to tweak a few things.
  • I don't like the permalink icons on the linkblog, so I added this code to .../skins/_linkblog.php

    40: if(!isset($linkblog_show_permlink)) $linkblog_show_permlink = 1;
    77: if ($linkblog_show_permlink)
    78:                         $Item->permanent_link( '#icon#' );
    
  • I don't like the 2006/10/01/title style permalinks, so I changed the code in .../inc/MODEL/items/_item.class.php

    531: $permalink = url_add_tail( $blogurl, $urltail );
    

    and in inc/_blog_main.inc.php starting at line 305:

    else
    {       // We did not get a number/year...
        if( isset( $path_elements[$i] ) && (!empty( $path_elements[$i] )) )
        { // We'll consider this to be a ref to a post
          // We are accessing a post by permalink
          // Set a lot of defaults as if we had received a complex URL:
          $m = '';
          $more = 1; // Display the extended entries' text
          $c = 1;    // Display comments
          $tb = 1;   // Display trackbacks
          $pb = 1;   // Display pingbacks
    
          if( preg_match( "#^p([0-9]+)$#", $path_elements[$i], $req_post ) )
          { // The last param is of the form p000
            // echo 'post number';
            $p = $req_post[1];              // Post to display
          }
          else
          { // Last param is a string, we'll consider this to be a post urltitle
            $title = $path_elements[$i];
            // echo 'post title : ', $title;
          }
        }
        else
          $path_error = 404;
    
  • I changed my TOC plugin to work in either 1.6 or 1.8
Permalink 01:55:20 pm, by Jeremy Email , 153 words, 7714 views   English (US)
Categories: B2Evolution

B2Evolution: Table of Contents plugin

Here is a plugin for B2Evolution 1.6, that creates a renders the special tag: <!--toc--> as a table of contents.

This way you can create a menu post that displays posts from a certain category. This is handy, if you use b2evolution as a content system for a traditional web site, not just as a blog.

Here is a sample use. For the top 5 posts in the B2evolution category, and the first 10 words from each post, showing dates; use: <!--toc dates="true" num="5" cut="10" category="29"-->

The blog's or the skin's css file can be used to customize the display of the table of contents.

Download the file and save it in your b2evolution plugins directory.

Update 1/30/2006: Download link fixed
Update 3/20/2006: The num option was being ignored, it is working now.
Update 7/17/2006: This plugin will work in B2Evolution 1.6 or 1.8.
Update 7/26/2006: Fixed some PHP warnings in the 1.8 code.

July 2006
Sun Mon Tue Wed Thu Fri Sat
 << < Current> >>
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          

Categories

powered by
b2evolution