We're three nerds doing our part to make the world just a little less stupid.

Eternalistic Designs

Freelance Switch

Quick Drupal Tips and Tricks

It's been a LONG time since my last post (roughly a year) so I thought it was time to finally post something new. I've been lucky enough to build quite a few Drupal themes lately and below are some bits of code that I use on a dailly basis when adding to or developing custom themes. The nice part is everything below should be easy enough to copy and paste!

*Note: All code below is for Drupal 6.

Views horizontal scrollbar

You know that annoying horizontal scroll bar that appears on your browser everytime you hover over a View on your site? This short bit of CSS gets rid of that. Place the following code in your theme's CSS file and away goes the horizontal scroll.

div.view div.views-admin-links {
  width: auto;
}

Admin page columns

Ever built a theme only to have the "/admin" columns display one on top of each other? That's typically due to not enough width in the content area to properly float the two columns. Add this bit of CSS to your theme's CSS file and you will no longer have the problem of floating your admin page columns.

div.admin .left,
div.admin .right {
  margin-left: 1%;
  margin-right: 1%;
}

Rounded tabs from Zen

I'm a big fan of the rounded "edit" and "view" tabs on the Zen theme and wanted to incorporate them into my own themes. There's a couple of files you'll need to edit but it's really quite simple copy and paste. Be sure to download the tabs images and place them in your themes folder in the "images/tabs" folder so the paths below match up.

The C# Version of Our ASP.NET AJAX CascadingDropDown VB Database Post

One of our most popular posts on this site, at least in terms of search engine traffic, is our Using ASP.NET AJAX CascadingDropDown With Visual Basic and a Database article from February 2008.  Long story short, in that article I broke down a Microsoft ASP.NET AJAX tutorial, translating their C# code into Visual Basic and used a MS SQL database for the datasource.  Good times.

Seems that some folks out there, people more inclined to use C#, actually like OUR example better and have spent time translating our code back into that language.  Oh, how the tides have turned.

One of those C#ers, a Mr. Bradley Hall, was kind enough to post his C# version of that sample code in the comments of that post.  With his permission, I'm throwing it up here, too.  Thanks again, Bradley.

 

Wait a minute... those aren't my stats!

Traffic here at Nerdliness is generally pretty level.  Sure, there's the occasional spike on days we post new content, and the overall trend is in the upward direction, but viewed over a monthly timeline the graphs are roughly flat.

A couple of weeks ago, I was doing my daily OCD-ish perusal of the Nerdliness.com Google Analytics reports and started seeing something odd:  a substantial bump in visitors.  My first thought was, of course, that Someone Important had recently discovered our sheer awesomeness and was preaching our gospel, but reality soon set in.

After investigating a little further, I noticed that the Content reports showed that all this traffic was directed at a page that doesn't exist.  I looked through our Apache access and error logs, trying to find any references to those URLs and came up with nothing.  

On the off chance that I might have actually made some sort of mistake, I also compared the Google Analytics report to our Google AdSense data.  Our 404 page has a couple of AdSense blocks on it, so I figured that, if it was the result of a bad link and visitors getting a 404 error, we'd see a proportional increase in AdSense impressions.

Nothing.

Looked around at every report, log, and portent I could think of and found nothing.  Double-checked our AdSense code snippet, looked good.  At that point, I was reasonably sure that it wasn't on our end and started to suspect that, perhaps, someone else was using our GA code.

So I emailed Google Analytics support. 

My Oracle Sequence/Datapump Shenanigans

I love sharing my screw-ups with you all.  One of my favorite things, right up there with raindrops on roses and whiskers on kittens.  It's therapeutic for me and, hopefully, helpful for you in the God-I-hope-I-can-avoid-HIS-idiotic-mistakes way.  Win/win.

Thankfully, it happens so often I've got enough material to keep this blog afloat for months.  Take our recent Oracle issues at the office.

We have a fairly large Oracle database in one of our remote offices that's home to about 200GB of GIS data.  In addition to that production version, we maintain a development copy of the data for, well, development. 

Occasionally, we need to move data between the two instances, and my prefered method for doing so involves using the Oracle Datapump utilities (expdp for exporting, impdp for importing).  My process looks something like this:

  1. Dump source database to disk via expdp.
  2. Copy dump file to destination server.
  3. Drop the schemas I need to refresh.
  4. Import the specific schemas via impdp.

I could just export the specific schemas that I'm interested in, but I like to get the full backup just in case there's some object I forgot I needed, etc.

Couple quick explanations for any non-Oracle types out there.  First, in Oracle, a "schema" and a "user" are essentially interchangeable terms.  Schemas own objects, can have roles/privileges granted to them, etc. 

For example, the TestUser schema could be granted the CONNECT role, thereby giving it the ability to, well, connect to the database.  The TestUser role might also be granted the ability to create objects like tables, views, etc., so you might find yourself querying the TestUser.TestTable table.

Know stuff? Try Aardvark

Last week, I was lucky enough to get an invite to test out a new "Social Search" application called Aardvark that was recently released into the wild.  Well, not completely into the wild (more on that in a sec), but wild enough that a no-talent hack like me managed to get an invitation (thanks again, @marshallk and @davidadewumi).

So here's how it works:

  1. You sign up.
  2. You tell Aardvark what types of questions you'd like to answer, rough categories like "Technology" or "Seattle."
  3. People ask questions through their IM client (Google Talk, AIM, Windows Live Messenger).
  4. Aardvark forwards that question along to a user on the network who's registered to answer questions about that topic.

You can tell Aardvark what times of day you're available to answer questions, and you always have the choice to Pass on one you can't answer.

A typical exchange might look something like this:

Aardvark Google Talk exchange

Asking questions is just as easy as answering them.  You just IM a question to the aardvark.im contact and poof, Aardvark does the rest. 

All in all, it's pretty damn cool, and extremely useful.  I can't wait to see what happens once they get more users with a wider knowledge base onboard.  Other than that, my only Wish List item would be Twitter support.

Now, getting back to that releasing-into-the-wild thing.  Right now, Aardvark isn't open to the public, so there are only a couple ways to get in on the fun: