Site Updates

aboutme — tags: , — rohand @ January 21, 2012 1:50 AM

I made two site updates today:

My Visual Studio Achievements are now listed in the sidebar. Ars published a wonderful article about the Visual Studio game engine.

My script parameters are
http://video.ch9.ms/widgets/VSachievements.min.js?
user=appwiz&
showPoints=false&
showDescription=false&
showTimeEarned=false&
showUserName=false&
showScore=false&
showIcon=false&
showDateEarned=false&
showMore=false&
showMainTitle=false&
defaultCSS=false

Next, I created a Chrome extension for this site. You can download the official appytizers Chrome Extension from the sidebar. Instructions on how you can create your very own extension are coming soon in a separate post.

And one more thing – the site has a new logo!

appytizers logo

Resolved: U-Verse Broadband Disconnecting Every Few Minutes

tech — tags: — rohand @ October 13, 2011 11:37 PM

I have had AT&T U-Verse at home for almost two years and the service has worked exceptionally. A few weeks ago, my modem started randomly disconnecting from the broadband network every few minutes. Nothing had changed in my configuration ever since it was first setup. It was baffling and frustrating because it also impacted the IPTV connection.

First, we called AT&T and they performed some line checks. They identified issues with the external wiring and dispatched a team to fix. This improved the HDTV service tremendously.

However, this didn’t resolve the broadband disconnects. I tried reconnecting every one of my computers and wireless devices but that didn’t help. I rebooted the modem and reset the wireless settings and the firewall settings to factory defaults – didn’t help. My modem was already sitting above ground and away from any blocking or interfering sources.

Finally, in desperation, I was ready to reset the modem to factory defaults and start from scratch. That’s when I noticed the RJ-11 cord and the power adapter were touching. I figured that maybe the power adapter was interfering with the RJ-11 data line. I moved apart the two cords so that they were not touching and rebooted the modem without resetting to defaults.

No more disconnects!

image

Breaking a Mirrored Volume in Windows 2008 R2

tech — tags: , — rohand @ September 27, 2011 10:22 PM

My Windows 2008 R2 Hyper-V server has 2 dynamic disks setup in a mirrored configuration that I wanted to split into the separate disks.

DiskManager

You can accomplish this from the command line using the diskpart tool. However, since this was my first time, I decided to play it safe and use the Disk Management Console.

First, I backed up all data on the mirrored volume. All information and advice I got suggested that I would not lose data but why take chances? It took approximately 4 hours to backup 400 GB.

Next, right click the mirrored volume. Remove Mirror lets you remove a disk from the mirror. Break Mirrored Volume destroys the mirroring and you lose redundancy. Data is retained on both disks that made up the mirror.

Select Break Mirrored Volume….

image

Say Yes.

image

Windows processes away for a few seconds and then I get my two separate disks. All data that existed in the mirror is available on both disks.

image

Windows Workflow Foundation Links

tech — tags: — rohand @ March 27, 2011 3:02 PM

Links from MSDN for the Windows Workflow Foundation.

Uptime SLAs

tech — tags: , — rohand @ March 7, 2011 8:54 AM

Vendors publish services with a guaranteed or defined uptime SLA. This chart translates the uptime % into the actual seconds, minutes or hours of permitted downtime.

This chart is provided as a reference only. Please check with the vendor for the definition of the SLA, the metrics used to calculate the uptime and the exclusions.

Total Seconds in a Year = 60 x 60 x 24 x 365 = 31536000

Uptime % Downtime
(Seconds)
Downtime
(Minutes)
Notes
99.9 31536 525.6 9 hours/year
99.91 28382.4 473.04 8 hours/year
99.92 25228.8 420.48 7 hours/year
99.93 22075.2 367.92 6 hours/year
99.94 18921.6 315.36 5 hours/year
99.95 15768 262.8 4.5 hours/year
99.96 12614.4 210.24 3.5 hours/year
99.97 9460.8 157.68 2.5 hours/year
99.98 6307.2 105.12 Almost 2 hours/year
99.99 3153.6 52.56 Less than an hour/year
99.999 315.36 5.256 5 minutes/year
99.9999 31.536 0.5256 Less than a minute/year
99.99999 3.1536 0.05256 Always up

DB2 TRUNCATE Clause

tech — tags: — rohand @ February 9, 2011 12:15 AM

The equivalent of the SQL Server TRUNCATE clause for DB2 v8 is

ALTER TABLE {TABLE-NAME} ACTIVATE NOT LOGGED INITIALLY WITH EMPTY TABLE

COUNT(*) All DB2 Tables

tech — tags: , — rohand @ August 13, 2010 9:37 AM

Here’s a succinct way of generating SELECT COUNT(*) against all tables in a DB2 database.

SELECT 'SELECT COUNT(*) AS COUNT_' || TABLE_NAME ||
' FROM ' || TABLE_SCHEMA || '.' || TABLE_NAME
FROM sysibm.TABLES
ORDER BY TABLE_NAME 

This returns output like the following:

SELECT COUNT(*) AS COUNT_ADVISE_INDEX FROM DB2INST.ADVISE_INDEX
SELECT COUNT(*) AS COUNT_ADVISE_WORKLOAD FROM DB2INST.ADVISE_WORKLOAD

Resize an Image in C#

tech — tags: , — rohand @ June 3, 2010 11:46 AM

This function will let you resize an image in C#.

public static Bitmap Resize(Bitmap original,
                        int width, int height)
{
  Bitmap bitmap = new Bitmap(width, height);

  using (Graphics gfx = Graphics.FromImage(bitmap))
  {
    gfx.InterpolationMode
            = Drawing2D.InterpolationMode.HighQualityBicubic;
    gfx.SmoothingMode
            = Drawing2D.SmoothingMode.HighQuality;
    gfx.PixelOffsetMode
            = Drawing2D.PixelOffsetMode.HighQuality;
    gfx.CompositingQuality
            = Drawing2D.CompositingQuality.HighQuality;

    gfx.DrawImage(original, 0, 0, width, height);

    return bitmap;
  }
}

Why is mcshield.exe Running with High Priority?

tech — tags: , — rohand @ April 25, 2010 2:13 AM

After weeks of putting up with significant disk activity and system slowness, I finally noticed that the McAfee anti-virus On Access Scanner process – mcshield.exe – was running as a High Priority process in Task Manager.

The fix was simple:

  1. Open Task Manager
  2. Switch to the Processes tab
  3. Find mcshield.exe
  4. Right-click → Set Priority → Normal

Task Manager - mcshield.exe

Happy system. Happy me.

List Stored Procedures with Contents in SQL Server

tech — tags: , — rohand @ April 7, 2010 8:47 AM

I needed to get a list of all stored procedures that accessed a specific column in a table. Some stored procedures generated dynamic SQL statements so the View Dependencies feature was not guaranteed to get me the full list.

This query lets me retrieve the name and body of all stored procedures in a database. Adding the filter to look for the specific column is relatively simple.

SELECT              o.Name AS SpName, c.Text AS SpBody
FROM                syscomments c WITH (NOLOCK)
JOIN                sysobjects o WITH (NOLOCK)
ON                  c.ID = o.ID
AND                 o.Type = 'P'        -- Only stored procedures
ORDER BY            o.Name

This query is for SQL Server 2005 but should work across all versions.

Find All Rows in Table1 That Are Not in Table2 Using JOIN

tech — tags: — rohand @ February 15, 2010 1:06 PM

To find all rows that are in dbo.TABLE1 but not in dbo.TABLE2 using the SQL JOIN operator:

SELECT              COUNT(*)
FROM                dbo.TABLE1 t1 WITH (NOLOCK)
LEFT OUTER JOIN     dbo.TABLE2 t2 WITH (NOLOCK)
ON                  t1.PrimaryKey = t2.PrimaryKey
WHERE               t2.PrimaryKey IS NULL

SQL 2008 – Manage DTS Packages

tech — tags: , — rohand @ January 27, 2010 5:25 PM

I installed the SQL Server 2008 Feature Pack to get the DTS components for SQL Server Management Studio 2008. However, the IDE continued to error until I copied the following files from the SQL Server 2000 manager to the SQL 2008 Manager folders.

You need to have SQL 2000 Enterprise Manager installed on the same machine.

Copy Components into SQL Server 2005

copy /y "%ProgramFiles%\Microsoft SQL Server\80\Tools\Binn\semsfc.dll" "%ProgramFiles%\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\semsfc.dll"
copy /y "%ProgramFiles%\Microsoft SQL Server\80\Tools\Binn\sqlgui.dll" "%ProgramFiles%\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\sqlgui.dll"
copy /y "%ProgramFiles%\Microsoft SQL Server\80\Tools\Binn\sqlsvc.dll" "%ProgramFiles%\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\sqlsvc.dll"
copy /y "%ProgramFiles%\Microsoft SQL Server\80\Tools\Binn\Resources\1033\semsfc.rll" "%ProgramFiles%\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\Resources\1033\semsfc.rll"
copy /y "%ProgramFiles%\Microsoft SQL Server\80\Tools\Binn\Resources\1033\sqlgui.rll" "%ProgramFiles%\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\Resources\1033\sqlgui.rll"
copy /y "%ProgramFiles%\Microsoft SQL Server\80\Tools\Binn\Resources\1033\sqlsvc.rll" "%ProgramFiles%\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\Resources\1033\sqlsvc.rll"

Copy Components into SQL Server 2008

copy /y "%ProgramFiles%\Microsoft SQL Server\80\Tools\Binn\semsfc.dll" "%ProgramFiles%\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\semsfc.dll"
copy /y "%ProgramFiles%\Microsoft SQL Server\80\Tools\Binn\sqlgui.dll" "%ProgramFiles%\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\sqlgui.dll"
copy /y "%ProgramFiles%\Microsoft SQL Server\80\Tools\Binn\sqlsvc.dll" "%ProgramFiles%\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\sqlsvc.dll"
copy /y "%ProgramFiles%\Microsoft SQL Server\80\Tools\Binn\Resources\1033\semsfc.rll" "%ProgramFiles%\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Resources\1033\semsfc.rll"
copy /y "%ProgramFiles%\Microsoft SQL Server\80\Tools\Binn\Resources\1033\sqlgui.rll" "%ProgramFiles%\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Resources\1033\sqlgui.rll"
copy /y "%ProgramFiles%\Microsoft SQL Server\80\Tools\Binn\Resources\1033\sqlsvc.rll" "%ProgramFiles%\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Resources\1033\sqlsvc.rll"

Do Not .IndexOf Without Further Checks

tech — tags: , — rohand @ January 26, 2010 11:42 AM

Do not do this:

if ("A,B,C,D,E".IndexOf(key) > -1)
{
    // CODE REDACTED
}

If key is an empty string, the result is 0 and the code in the IF block is executed. This is probably not what you expected.

Next Page »
©2012 appytizers. All rights reserved.