Posts tagged How-To

DB2 – How to get the Relative Record Number sequence

0

My scenario was this:
Pulling in several million rows of data from a DB2 database system into an Enterprise 2012 SQL Server Analysis Services setup. This data was basically tranasction records keyed on several fields, like Location, job numbers…etc. And this data was from a main system that was not developped or maintained by the devs I work with.

But in the data’s structure there was an element that wasn’t completely rock solid. That was trying to get the most recent transaction of it’s type based on a max date, max time (on the given date) and also a max sequence number.

Problem was on occasion there was no sequence number and even no time records… really making it impossible to accurately get the desired results. This transactional data is used, from what I can tell, as a log that is compiled by a few different “sub programs” or modules within the main application.

This data was accessible through the legacy system, an ancient green screen program, which still worked quite well but was no longer being used. However, in this program when viewing the data you could see record level keys… but these were not accessible by query field.

These were loaded in correct sequence and give the desired results (in my case) with the proper criteria.

We didn’t think, at first, that it was possible to get these record numbers which wouldn’t just fix the current problem but also simplify our update scripts.

After a little research (thanks Google!) I found that it was so very easy.

I found DB2’s RRN() function. All I had to do was pass the table name to the function in the query and the RRN function would return this Relative Record Number.

Ex:

SELECT RRN(users) AS rID,FirstName,LastName
FROM users
FETCH FIRST 10 ROWS ONLY

Or using an alias on the table name

SELECT RRN(u) AS rID,FirstName,LastName
FROM users AS u
FETCH FIRST 10 ROWS ONLY

This query would return 10 records (SQL server TOP 10 equivalent) with rID as the Relative Record Number.

Adding a sidebar to post view in Twenty Eleven WordPress Theme

0

Something else I missed when looking at themes for my new blog was post template options.

Seems as though the Twenty Eleven theme won’t display the sidebar when viewing a post/article.

Thankfully, it’s not a huge modification and there is lot’s out there on how to do it.

Basically, you modify the theme’s single.php file and add the get_sidebar() function. But that in itself will not be enough, you need to adjust some CSS as well.

I had tried with just the get_sidebar() modification… but after a quick search I found an example.

Check out Zeaks “ADD SIDEBAR TO POST VIEW IN TWENTY ELEVEN THEME” for an example on how to modify the CSS to make this work.

I used it as a reference and it worked great.

How to add custom banners to Worpress TwentyEleven theme

0

I’m setting up a new personal blog and settled on using WordPress’s Twenty Eleven theme that ships with current downloads.

I wanted to create custom banners to be displayed in the “Header” settings under the “Appearance” menu.

I thought they could be uploaded, this was something I simply presumed and didn’t actually check. I had seen the options to display a random header but hadn’t actually tried it… or read everything for that matter… 😉

There aren’t any uploaders. If you do upload a custom banner it is set as the banner for all pages.

The work around was quite easy, if you can follow PHP code of course.

First, create the banners you want to have on the blog, at appropriate sizes of course (defaults are 1000 × 288 pixels for the banners on the Twenty Eleven Theme out of the box). Then, your thumbnails (230×66 pixles, less important as it’s for the admin panel)…. then go into the theme’s image folder (unless you want to change those settings, but we won’t get into that here). Theme folder should be in:
/wp-content/themes/twentyeleven/images/headers

Upload your banners and thumbnail images.

Once that is there, you must open the theme’s functions.php file (in twentyeleven’s root folder). In there, find the register_default_headers() function. You’ll want to configure your custom banners in the arrays as such:

register_default_headers( array(
'every-man-lives' => array(
'url' => '%s/images/headers/first-banner.jpg',
'thumbnail_url' => '%s/images/headers/first-banner-thumbnail.jpg',
/* translators: header image description */
'description' => __( 'Banner 1', 'twentyeleven' )
),
'love-dies' => array(
'url' => '%s/images/headers/second-banner.jpg',
'thumbnail_url' => '%s/images/headers/second-banner-thumbnail.jpg',
/* translators: header image description */
'description' => __( 'Banner 2', 'twentyeleven' )
)
) );

Once you’ve registered the new banners, refresh the admin panel Header or Custom Header page and check out the public site.

Was nice and simple.

How to Fix Skype crash (APPCRASH) in Windows 7

64

So today when I logged into the computer to start work I had a most unpleasant surprise.

That being that Skype was unable to start. I use Skype a whole bunch in my “day to day” work activities. It’s how I keep in contact with my current “work team”.

Looking into the details, the message was APPCRASH. I didn’t have much to go on and I cleaned off the computer as I thought it may have something….. which it did. Some spy-ware and malware. I believe it may have picked some up from some “Girls games” sites my daughter plays on from time to time.

Anyways, cleaning this thing off didn’t do anything.

Eventually, I found Aasim Naseem Siddiqui’s blog and the answer was there. There are directions for fixing this for Windows 7, Mac OSx, XP and Linux.

Thank you so much Aasim!

I will post the Windows 7 solution here.
Find and delete the shared.xml file in the Skype data folder located here:
C:\Users\%username%\AppData\Roaming\Skype

Restart Skype and there you have it. Worked fine for me. Skype likely shouldn’t be running if you do this… but if you have this problem, Skype probably isn’t running anyways right???
😉

Once again, Thanks to Aasim for posting this on his blog. And for the other OS fixes, please visit his blog:
http://aasims.wordpress.com/2011/05/26/how-to-fix-skype-crash/

Very useful WordPress 3 User Guide

0

I’ve recently developped a few sites based on WordPress and have done a bit of training with users on how to administer their websites. Like editing their texts, images, categories, tagging….etc.

So I’ve been thinking about developing a half visual document for them. Something that would contain the generic “Post, Page, Category, Media”…etc. Along with some documentation on installed plugins or theme options which would be a bit different depending on the site.

This morning while doing a quick Google Search, I came across what appears to be a VERY well done WordPress guide and thought I would share.
(more…)

Facebook "Like Box" options

Manually tweeking your Facebook Like Box

3

This evening I had a particular little bug come up with the normally simple task of creating and embedding a “Facebook Like Box” and thought I’d jot down a few words on it.

I was using Facebook’s options to customize a “Like Box” for a Facebook Page that I was then going to embed into a new website. All was well, I’d change the options and the preview would change accordingly.
(more…)

How to capture a screen shot in Mac OSx

0

In the spirit of my last blog post… I’m writing this one too, in part, because I simply don’t use the shortcuts often enough to actually remember them.

I’m not going to list all the commands here, I’ll list those I use the most.

1. How do you capture the entire screen?
Just press the Command + Shift + 3. A .png image will automatically be saved to your desktop. Nice and handy.

2. How do you capture a portion of the screen?
Again, simple…. press Command + Shift + 4. You’ll now be able to select a section of the screen with the mouse. And just like the first, a .png image will be saved to your desktop.

There are some more variations to screen shots and the Mac here.
(more…)

Go to Top