johnk's blog

Gentoo, Luxi, the Weller BP645 Soldering Iron

Finally, after all these years, I've installed Gentoo. It's really nice, and reminds me of BSD Ports, except that the documentation is more thorough. Ports is good, but Gentoo's emerge is really, really nice. It's also fast, as expected, and took a long time to build, as expected.

Future Web App Development

Things to read and research:

Adobe Flex
Google Web Toolkit

More info - Ajaxian

Not a framework - Scriptaculous which uses Prototype. (That and JQuery are in another post.)

Updating a Combo Box with a Requery

In MS Access, when you want a form containing a foreign key, you typically use a combo box that's populated with data from the foreign table.

Perl Rocks (even yet)

Perl still rocks. People still say it's hard to read (true), but it's because the language is terse.

sub getAccountIdsOfSitesToSuspend
    $sql = <<EOQ;
        SELECT account_id
        FROM account
            account.account_balance < (SELECT triggerAmount FROM fk_suspension_rules)
            AND (
                    SELECT IF(SUM(transaction_ammount), SUM(transaction_ammount), 0)
                    FROM transaction
                    WHERE transaction_date > DATE_SUB( CURDATE(),
                        INTERVAL (SELECT paymentWindow FROM fk_suspension_rules) DAY)
                    AND transaction.account_id = account.account_id



A good tutorial at DDJ.

There's going to be a conflict with Prototype, because it also uses $, but differently.

Add HTML Tags to PHP...; A

One cool thing about geeking out with Josh is that new ideas happen. The latest one that came up was to make <SPAN> and <DIV> (and their closing tags) part of the PHP language syntax. This isn't going to happen, but think...

Those two tags could be treated like double quotes, and the content within them can, by default, echo to the page. Example:

if ($i==true) 
  <div>Hello, world.</div>

If you need to evaluate:

if ($i==true)
  <div>Hello, {ucfirst($name)}</div>


while ($line=readline($fh)):

On second thought, this isn't just for PHP. Pretty much any language could use it. It just doesn't make sense in other languages, because they don't spit out web pages.

Typewriter as Computer Keyboard

How cool is this?

Project 1

Project 2

Linux Point-of-Sale Spotted at Mitsuwa Market

The Mitsuwa Market in Los Angeles is using a POS system that runs on Ubuntu Linux. The POS was odd, because it didn't disable the menu bar. The Ubuntu logo was right up there. It even used the default orange theme.

Coding Tactics, Mysteries of Access

Tactics, tactics, tactics: an essay about how to become a better programmer by studying code. Great analogies.

Why does Access hurt? It's just weird how you can modify the standard controls in Access, but they usually look like crap. You get a lot of control, via the numerous object properties, but, the interface never looks very nice.

OMG: Audiophiles...

OMFG. This is wrong. It seemed the "in" thing for audio geeks, circa 2001, was to start using XLR connectors to wire together their stereos... to get balanced signals. Or "balanced", because those heavy duty cords and connectors are supposed to deliver mono audio signals.

Old Atheros-Based WiFi Cards

For a number of reasons, Linux works well with Atheros cards, but not so well with Broadcom (unless it's in an embedded router). It seems like the distros all have support for the old MadWiFi driver. This is a short list of cards with ebay links:

Netgear WG311T

SysRank, a Scoring System to Determine Computer Performance

This is a simple formula to rank computers, so you can determine which machine in the network should probably be upgraded first.

SysRank = Sqrt( (CPUs * CPUSpeed) ^ 2 + Memory^2 + DiskSize) )

This doesn't account for things like the actual performance you get when you're using the computer, what the computer's purpose is, and other more important qualities. It's just a basic formula you can use to sort your list of computers, to get a good idea of which one could use some help.

Gentrification Perspective

I was researching gentrification, and came up on a ton of interesting articles, but this one was particularly interesting because it's from someone who identifies with the displaced.

Brown Kingdom

He sites the origin of gentrification in the decline of locally owned business. True enough, I suppose, but even locally owned businesses tend to spawn remotely owned ones, over time, when the second generations of owners move away to fancier areas, and sell out to ever-larger entities.

The blog is good, with a lot of interesting historical information and opinion.

Drupal: Upgrade Notes

Crap... this upgrade didn't work out so great. A detailed check of the tables show that the tables are okay. For some reason, the data isn't quite right, and I need to fix up the themes.

Drupal: Upgrade Notes

Been upgrading from an old Drupal 4.5 (aka Civicspace 82) to Drupal 5.1.

Dropping CiviCRM

I had to get rid of the unused civicrm tables. Installing it seemed like a good idea at the time, but no point of using it for a tiny campaign. Here's a script that will delete the tables. It's posted here because the InnoDB engine complains if you drop these in the wrong order, and violate some constraints.

drop table if exists `civicrm_activity`;
drop table if exists `civicrm_activity_history`;
drop table if exists `civicrm_activity_type`;
drop table if exists `civicrm_address`;
drop table if exists `civicrm_county`;
drop table if exists `civicrm_custom_option`;
drop table if exists `civicrm_custom_value`;
drop table if exists `civicrm_donation_page`;
drop table if exists `civicrm_email_history`;

Syndicate content