All posts by Webb

Webb is a husband, father, and software engineer. When not enjoying family time, he enjoys tinkering with gadgets and web technologies.

SQL Server Table Size – SQL Table Size

SQL Table Size

Today I wanted to know which tables were taking up the most space in a database. The backup had doubled in size and I wanted to find the culprit. This StackOverflow converstion got me up and running with the following:

SELECT 
    t.NAME AS TableName,
    s.Name AS SchemaName,
    p.rows AS RowCounts,
    SUM(a.total_pages) * 8 AS TotalSpaceKB, 
    SUM(a.used_pages) * 8 AS UsedSpaceKB, 
    (SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB
FROM 
    sys.tables t
INNER JOIN      
    sys.indexes i ON t.OBJECT_ID = i.object_id
INNER JOIN 
    sys.partitions p ON i.object_id = p.OBJECT_ID AND i.index_id = p.index_id
INNER JOIN 
    sys.allocation_units a ON p.partition_id = a.container_id
LEFT OUTER JOIN 
    sys.schemas s ON t.schema_id = s.schema_id
WHERE 
    t.NAME NOT LIKE 'dt%' 
    AND t.is_ms_shipped = 0
    AND i.OBJECT_ID > 255 
GROUP BY 
    t.Name, s.Name, p.Rows
ORDER BY 
UsedSpaceKB

If you are using SQL Server 2012+ you can try this as well:

  1. Right click on the database in Object Explorer
  2. Select Reports -> Standard Reports -> Disk Usage by Top Tables

Thanks again StackOverflow.

IE10 and IE11 can’t type “t” or “T”

Today I had the opportunity to solve a problem with a login form on an old web application. The problem had to do with users using Internet Explorer 10 or Internet Explorer 11 and had a “t” or T” in their username or password. If the user typed the “T” key, nothing new was displayed in the box.
This was very curious, as the “T” key appeared to be the only key affected. I had a sneeking suspicion that javascript was the culprit, but I wasn’t sure where. Anxious to find out what the issue was, I loaded the login page and fired up the Developer Tools by pressing F12. I then clicked on the Debugger tab, followed by the pause button.
At this point I tried to type a “T”. I was brought to a legacy javascript function put in place to cancel keystrokes for refresh. It was looking for event.keyCode == 116. I hovered over event.keyCode and discovered it was 84. This shouldn’t cause the event cancel. I continued stepping through pressing F11. This brought me out of the function without a cancel as I expected.
I continued out of the function and pressed F11 once more and was very surprised when I discovered the function was called a second time. This time the event.keyCode was set to 116. This should be the F5 (Refresh/Reload) key. The fact that the function was called a second time was unsettling to me. I searched the code to determine where the function was being called and found this golden gem:
// Additional code for NS
if (navigator.appName==”Netscape”) {
 document.addEventListener(“keypress”,showDown,true);
}
document.onkeydown = showDown;
Apparently, once upon a time we were trying to special case Netscape Navigator. This code was now being called as well as the existing call to onkeydown. After removing this old Netscape special case, the expected functionality returned.
So if you find yourself staring at unexpected functionality with newer versions of IE, check your code for legacy checks and hacks in the javascript.
Have you encountered other legacy javascript gotchas? Let us know in the comments.

Inland ProHT bluetooth wireless headphones foam ear cover replacement

I couple years ago, I picked up a pair of Inland Pro-HT Bluetooth headphones to use at my desk at work. I wasn’t looking for top of the line, I just wanted to stop hanging myself when I got up from my desk quickly.

Recently, one of the foam covers disappeared. I’m not sure where I took the headphones that allowed the cover to disappear, but they are very uncomfortable without that cover.

I decided to first check Amazon to see if I could find a replacement, but amazingly was disappointed. Next, I decided to check Google for exact replacement ear covers. The only thing I could find was more people looking for them.

I now resorted to the idea of just using a generic ear cover, so off to Amazon I went again. I found some fairly cheap as an add on prime item. Then I had another thought. If I am going to just use a cheap alternative, why not try a cover from a cheap pair of headphones from the dollar store?

Yesterday, at lunch, I stopped by the local Dollar Tree and grabbed a pair of stylish zebra print headphones with foam ear covers. 

I removed one of the foam pieces, and then stretched it over the plastic pegs the original ear cover attached to.

$1.06 later, I am comfortably rocking out to Mandatory Fun on Google Play All Access at my desk whithout wires again. What initially complicated problem have you solved with a cheap stroll to the dollar store?

No data available – Windows Media Center Guide Data Missing

This is not the way you want to start your evening. If you are one of the unfortunate souls who has been hit with an empty guide, hopefully this will help you get back to the awesomeness of the Media Center experience.

Backup

Wait, my guide is busted, why would I backup now? Recording Schedule! Ian Dixon, of The Digital Lifestyle has created a handy utility to backup and restore Media Center settings called mcBackup 3.0 from Made for Media Center. This utility allows for the back and restore of Scheduled Recordings, Channel Lineup, Recorded TV, Extra Folders. So, before we go any further, backup the recording schedule. I recommend this just in case things get worse before they get better.

Guide Recovery

To restore proper guide data, I had to step through the Setup TV signal wizard. The following screenshots step through the wizard. Don’t schedule the eye exam just yet, the following screenshots are a tad blurry. (Note to self: Don’t shrink Media Center so much when taking screen shots).

These configuration steps allowed Media Center to pull the proper data again. It did take a few (five) minutes for the data to populate again, but I was soon back to the wonderful state of upcoming recordings and a full grid of guide data. The following screenshot shows my guide data restored.

Recording Schedule Recovery

The scheduled recording data was unaffected by the TV Signal Setup wizard. If you were not as lucky, now is when you can pat yourself on the back for creating a backup before you began. Go back into mcBackup and restore your Scheduled Recording (Be careful, you do NOT restore your Channel Lineup at this point)

Conclusion

This article documented the steps I took to restore my Windows Media Center Guide to its usual state of awesomeness, as well as adding some fail safes along the way. I would like to thank Phil Lozen from http://thedigitalmediazone.com for discussing his issues with his guide, causing me to check my guide. I rarely watch linear television, so without warning, I could have lost out on the opportunity to record quite a few shows. Have you experienced similar issues with your guide data?

What is Android? – Android 101

What is Android?

Since I work in the tech industry, I get asked questions about technology and gadgets very frequently. Lately, you can’t watch any Television shows without seeing a commercial for a Google Android phone. So what is Android? Wikipedia describes Android as an operating system for touch based devices like smartphones and tablets. Android is a very customizable, multi-tasking operating system. As of September 2012 1.3 million Android devices are activated everyday. For perspective, the state of Main’s population was roughly 1.3 million in 2011.

Why Android?

Android is enticing to the handset makers due to the licensing from Google is free. There has been paten litigation brought against some handset manufactures claiming patent infringement of some of the functionality of android, resulting in licensing deals in some cases, and ongoing litigation in others. In some cases this has led to cross licensing agreements, allowing two handset manufacturers to share access to each others patents. In other cases, handset manufacturers have drawn a hard line in the sand, and are battling the claims in court.

The second reason handset manufactures are drawn to Android is its Open Source roots. Google provides the source code to the Android operating system, and the manufacturers are free to modify it to tailor the experience how it sees fit. This allows each manufacturer the ability to but their own style and increase their brand. It also allows for carrier customizations. This can be both a blessing and a curse The blessing is that these customizations can drive innovation and bring added functionality to customers. The curse is that these customizations are changes on top of the base Android code, so any update Google makes to the operating system, the manufacturers need to streamline their customizations into the new code and fully tested by themselves ad the carriers before being delivered to the customers..

App Ecosystems

Apple made made handset applications a household phenomena with their slogan “Theirs an app for Everything” and thus consumers are curious about applications or Apps on their phones. Google launched Android with their application marketplace Google Market, which has since seen a name change to the Google Play Store. This would only be licensed if the device was determined by Google to be up to their standards. This lead Amazon to launch their Amazon AppStore for Android. The Amazon AppStore for Android is a competing marketplace for users to acquire applications , both paid and free. Also some carriers have created their own marketplace for customers to purchase apps directly from them.

Hardware Features

  • WiFi – Broad range wireless Local Area Network (LAN) connection
  • Bluetooth – Mid-range wireless communication protocol for connecting devices such as headsets, headphones, microphones, keyboards, and mice
  • Near Field Communication (NFC) – Very short range communication protocol for transferring information. Currently being developed for mobile payment applications.
  • Wireless Charging – Qi and Power Matters Alliance are two competing standards that aim to allow you to charge a device without plugging a cord into them
  • 3G –
  • 4G
    • WiMax – Worldwide Interoperability for Microwave Access (Once touted as the $G standard of the future, not being overlooked for LTE)
    • LTE – Long Term Evolution (The future of cellular data transfer)
    • HSPA – High Speed Packet Access (Speed boost of current 3G technologies, dubbed 4G for marketing purposes)

Conclusion

In summary, Android as an operating system for touch based devices like smartphones and tablets that id highly customizable. Android handsets are being activated in record numbers and are quickly becoming the dominant operating system in the mobile market. Check one out at your local carrier today.

References

Wikipedia
CNN
Kennebec Journal

AMD 6670 HD Audio Intermittent Problems – Audio Cutting Out

Discovery

Our family has fully welcomed the Windows Media Center ecosystem. Our living room big screen tv is driven solely from our Media Center home Theater PC (HTPC) or our XBox360. This summer, AMD released an update to the AMD VISION Engine Control Center, which along with it updated the HD Audio driver for our AMD Radeon 6670 video card. Unfortunately, this update introduced a very annoying and inconsistent audio anomaly.  Randomly , while watching Recorded TV , the audio would drop out for a few seconds. Sometimes this would happen frequently, sometimes it would disappear for an entire TV show viewing. 

Analysis

Our first step in troubleshooting this issue was to determine whether the issue was with the recordings or with the playback. As stated earlier we have an XBox360, so we utilized the extender functionality to watch the recording that we were having difficulty watching. Fortunately, this test proved that the recordings were no the issue. The recording playback performed beautifully through the XBox360. This pointed us to the HTPC connection to the TV. We verified that the HDMI cable was connected properly to the TV and the HTPC.  We tried a different HDMI cable to ensure the cable hadn’t broken, or acquired some new interference. After these tests failed, we tried each subsequent AMD release and some beta drivers along the way, each leaving us disappointed.

Resolution

We’ve been limping along utilizing the XBox360 as our consumption device. This holiday weekend, I was determined to figure out a resolution and return our system to the stable entertainment system of awesomeness we’ve come to expect. While Googling around looking for AMD 6670 HD Audio Problems  I discovered this post xbmc.org: (http://forum.xbmc.org/showthread.php?tid=134993), describing the utilization of the Realtek HD Audio Codecs found here . After the previous failed attempts had failed, I jumped at the oportunity to try a new audio driver, however, this step should be taken with care. Please make sure your backups are up to date before installing or removing any device driver!
I was borderline giddy as I finished my test episode of Mythbusters which “Confirmed” the results of the test.  The Realtek driver has returned our system to its previous state of awesomeness. Hopefully this post will help you if your system is having similar issues.

Going Paperless with the Fujitsu ScanSnap S1500

Going Paperless

My wife and I have had the itch to go paperless for a few years now, but we did not have the time to invest to work through the complicated setup. We wanted to create a solution that would allow us to access any of our scanned documents individually anywhere we were. Most importantly this process had to be easy and convenient or we wouldn’t be diligent in using it.

We made a few attempts a few years back with our all-in-one printer/scanner. This was definitely not ideal and was very time consuming. We keep the majority of our computing accessories in the basement, so when using our all-in-one printer/scanner, we would have to walk down stairs, scan each page individually as it was a flatbed scanner without a document feeder, then process/organize the scanned images. As you might imagine this did not last long.

We wanted a fast scanner, that could scan multiple pages, both sides at once, and in a convenient location. News Flash: Speedy duplex scanners are NOT cheap. We were a little overwhelmed when we started to research our new scanner. We wanted to find the most convenient machine to help ensure the success of our system. Eventually we realized that we were going to have to pony up some change to achieve the convenience we were looking for. Enter the Fujitsu ScanSnap S1500.

Why did we settle on the ScanSnap? We did a LOT of reading, and then did some more… This review at lawyerist.com sealed it for us. Again, we were looking for convenience, it has to work quickly and reliably, and this scanner does just that.

The next piece of the puzzle was how to store the scanned documents. We had already decided we wanted to utilize Evernote to organize our documents. We had also researched different strategies for automating the transfer of the documents from the scanner to Evernote. We installed the supplied driver application and Evernote version supplied on the CD. We updated the software immediately to the latest versions. We were pleasantly surprised to realize that the newest version of the ScanSnap software had Evernote integration BUILT RIGHT IN!

We created a new evernote account to house our scanned data. We did not use either of our existing individual accounts, we use the new account and share the notebooks from there to our individual accounts. This allows us to keep our personal notes in our own accounts, but still have access to our shared scanned data. We allow evernote to use its Optical Character Recognition (OCR) algorithms determine the text in each document. Now we can search our shared documents from the shared account or our individual accounts. My wife likes to be organized, so she moves the documents into categorized notebooks. I typically just search for what I’m looking for. Oh, did I mention they have apps as well?
Android app on Google Play

I mentioned earlier, that my setup needed to be convenient. We currently use Windows Media Center for our DVR functionality, so we have access to a computer on/near our television. We chose to put the scanner next to the TV, so we have easy access to it while going through the mail. We scan the mail, and then toss it in the recycle bin or put it through the shredder.

In summary, we wanted a fast and convenient scanner for the backbone of our paperless solution, and the  Fujitsu ScanSnap S1500 handles this assignment brilliantly. Evernote provides the features to handle the tasks we need after the ScanSnap has digitized our data. This is the solution that is working for us right now, but as always, your mileage may vary.

Using Swype Beta on Rooted Kindle Fire

Pre-requisites:

  1. Your kindle must be rooted. I used Kindle Fire Utility from XDA.
  2. You must have a file manager capable of mounting /system writable. I use E. S. File Explorer.
Installation:
  1. Fom your Kindle Fire download the Swype beta from here.
  2. Run Swype intstallation package.
  3. Enter your beta credentials.
  4. When the installation asks to “Enable Swype”, Press Home button.
  5. Open ES File Explorer. Select Menu->Settings. Under Path settings, select Up to Root. Under Root Settings select Mount File System. Back out of settings.
  6. Select Up to go up to the root / level. Navigate to data/app. Cut com.swype.android.inputmethod-1.apk. 
  7. Navigate to /system/app/, paste  com.swype.android.inputmethod-1.apk.
  8. Navigate to /data/data/com.swype.android.inputmethod/lib/. Cut 

Playing the kids shows on repeat all ( successively by series)

The greatest part of using Windows Media Center is the ability to use plugins to customize the interface/functionality to your liking. I stumbled upon a very handy plugin this week called Recorded TV Marathon.

This handy little plugin will play your tv recordings back to back by series. This can be a godsend when it comes times to finish your homework and the little ones just want to watch Mickey Mouse. http://www.fjdrasch.com/Marathon/