Pages Menu
Categories Menu

Posted by on Apr 7, 2015 in Blog, Computer Tips, Programming | 0 comments If then Else with a list of strings


In SQL server you can do an easy exclude or include list by using an in statement.
So you can do:

Select * from someTable where somecolumn in (‘somestring1′, ‘somestring2′, ‘somestring3′, ‘somestring4′)

So you only get records where the contents of somecolumn are in the specified list of strings.
I wanted to do something similiar in
You can use an if then or statement but it can get messy.

If someStringToCheck = “somestring1″ or someStringToCheck = “somestring2″ or someStringToCheck = “somestring3″ or someStringToCheck = “somestring4″ then
…Do something blah blah…
end if

This works but what if you have a list of 20 strings you want to check for?
Through some internet searching I found this post on and came up with the following:

Dim someList = New List(Of String) From {“somestring1″, “somestring2″, “somestring3″, “somestring4″}
If someList.Contains(someStringToCheck) Then
…Do something blah blah…
…Do something else blah blah…
end if

It seems kind of backwards but it takes your list of strings and determines if the string you fed it is in that list.  If so do something or if not then do something else.

Read More

Posted by on Apr 3, 2015 in Blog, Computer Tips, Programming | 0 comments

How to sort DirectoryInfo.Getfiles array

I have an Intranet page that looks at a folder of files and lists them out.  It uses io.directoryinfo.getfiles to get the list of files but there wasn’t anyway to control the sorting.  By default it was sorting ascending but i wanted it reversed.  Here’s what I had at first:

Dim di As New IO.DirectoryInfo(Server.MapPath(“FolderofFiles”))
Dim aryFi As IO.FileInfo() = di.GetFiles(“*.pdf”)
Dim fi As IO.FileInfo
For Each fi In aryFi
..blah blah loop

I tried to add Array.Sort(aryFi) but that resulted in an error:
“At least one object must implement IComparable.”

So after some internet searching I came up with the following based on a post on

First you have to create an IComparer class:

Private Class FileNameComparer
Implements System.Collections.IComparer
Public Function Compare(ByVal info1 As Object, ByVal info2 As Object) As Integer Implements System.Collections.IComparer.Compare
Dim FileInfo1 As System.IO.FileInfo = DirectCast(info1, System.IO.FileInfo)
Dim FileInfo2 As System.IO.FileInfo = DirectCast(info2, System.IO.FileInfo)
Dim Filename1 As String = FileInfo1.FullName
Dim Filename2 As String = FileInfo2.FullName
If Filename1 > Filename2 Then Return -1
If Filename1 < Filename2 Then Return 1
Return 0
End Function
End Class

Then use the comparer to sort:

Dim di As New IO.DirectoryInfo(Server.MapPath(“Folderoffiles”))
Dim aryFi As IO.FileInfo() = di.GetFiles(“*.pdf”)
Dim comparer As IComparer = New FileNameComparer()
Array.Sort(aryFi, comparer)
Dim fi As IO.FileInfo
For Each fi In aryFi
..blah blah loop

The comparer I tweaked sorts the files by their filename in a descending order.  You can reverse the Return -1 and Return 1 to get them into ascending order.
Also, if you would like to sort the files by creation date you could use this comparer:

Private Class DateComparer
Implements System.Collections.IComparer
Public Function Compare(ByVal info1 As Object, ByVal info2 As Object) As Integer Implements System.Collections.IComparer.Compare
Dim FileInfo1 As System.IO.FileInfo = DirectCast(info1, System.IO.FileInfo)
Dim FileInfo2 As System.IO.FileInfo = DirectCast(info2, System.IO.FileInfo)
Dim Date1 As DateTime = FileInfo1.CreationTime
Dim Date2 As DateTime = FileInfo2.CreationTime
If Date1 > Date2 Then Return 1
If Date1 < Date2 Then Return -1
Return 0
End Function
End Class

Then you’d change:

Dim comparer As IComparer = New FileNameComparer()
Dim comparer As IComparer = New DateComparer()

Read More

Posted by on Jul 21, 2014 in Blog, Computer Tips, Microsoft Exchange | 0 comments

Exchange 2013 auto mapped mailboxes don’t close when removed

I have an Exchange mailbox with several other mailboxes that it has full permissions on.
Exhange 2010 or 2013, I don’t remember which, added a feature that adds the mailboxes to Outlook automatically.
So, instead of having to go to account settings and navigating to advanced settings and manually adding additional mailboxes to open it does it for you.

That’s great except when you don’t want them to or when you remove the full access permissions and it decides to stay in Outlook.

To remove a mailbox that keeps showing up even though you’ve removed the Full access permissions.  Open Active Directory Users and Computers find the users account.  Click on Attribute Editor.  Scroll down the list until you find msExchDelegateListLink and remove the user account you don’t want the mailbox showing up in.

You can also turn off Exchange auto mapping on individual accounts.
This will give Administrator full access on the TheUser account without automatically adding it to Outlook:
(so you will have to manually add the account in account settings, open these additional mailboxes)

Add-MailboxPermission -Identity TheUser -User ‘Administrator’ -AccessRight FullAccess -InheritanceType All -Automapping $false


Read More

Posted by on Aug 16, 2013 in Blog, Computer Hardware, Computer Tips | 5 comments

The best remote for a HTPC

I’ve mentioned in the past that I use a HTPC (Home Theater PC) for streaming movies from my local network (a network share on a Windows server) to my TV.  There has been a huge amount of streaming boxes hit the market lately and I’ve tried many of them.  I use a Roku 3 for most Netflix, Hulu, Amazon and Pandora activitiy.  When it comes to streaming local content XBMC is hands down the best (see my previous post about using it with Windows 8).  I do have Plex on my Roku and the server piece on a server where I store my videos.  Plex works well and is on all platforms.  I just like playing the native video file as it is and not have to transcode to a client.   I also just really like the interface of XBMC.  I had hoped the port of XBMC to the Ouya would possibly replace my HTPC but I don’t think it’s been released yet and I’m not super optimistic that it will be as nice and fluid.  So my Ouya sits mostly untouched for now.

To this end I’ve been on a never ending quest to find the right remote control for my HTPC.  I’ve tried many different remotes.  The one that came the closest but still wasn’t quite there was the Logitech diNovo (goofy name) mini PC entertainment keyboard.


It’s actually a very nice keyboard and remote but it’s a bit awkward, somewhat overpriced and I never got really comfortable using it.  Before this I used a remote from nMediaPC.


It worked well most of the time but didn’t have an integrated keyboard.  It came with a normal sized wireless keyboard that was too big and bulky.  It didn’t take long for the trackball mouse to start acting up.
Before this I had also tried the Rii Mini Keyboard with touch pad.


This one was not bad.  The keyboard worked well though the touch pad could be a bit sensative.  It was backlit and is a good price on Amazon.  My problem with this one was battery life and it was a bit awkward in the hand.  It seemed like the battery was dead every time I picked it up, especially after sitting for a week or so unused.  It’s also not really a one handed remote which I prefer.  I also tended to have some sticking keys sometimes.

Before that one there were many more.  I like experimenting and the old devices tucked away in my closets show this.  I could probably dig up and photograph 5 or 6 more remotes but I won’t bore you with that.

So, my current and so far favorite HTPC remote?
It’s the MCE Remote Control by Feilan.
I purchased it from Amazon for about $26.


The remote has a keyboard integrated into it.  A trackball (kind of small) for mouse activities.  This also is a learning universal remote so I’ve programmed some of the buttons to turn on my TV and home theater systems.
The remote is nice to hold in the hand and isn’t cheap feeling like some I’ve used.  The keys all work well, though there’s a few that are too close to other keys like the left and right cursor.  The battery life is great.  It has zoom in and out buttons which are nice for browsing the web.  The ctrl-alt-del function is a nice touch for those times Windows or an application isn’t acting right.  The play, volume and other buttons work well with XBMC.  The instructions that came with it are pretty sparse (poorly translated from Chinese) and there’s no real online help.    I’ve tested and used the remote with both Windows 7 and 8.  Overall it’s a great remote and I don’t plan on looking for a replacement just yet.  I’ve had the remote for about 6 months and it’s performance has been reliable and consistent.  I did notice on the Feilan website there’s another version (actually several versions that all look very similar) of the remote that has back lighting that would be nice but I haven’t found anywhere to buy it just yet.  That would be the only reason right now to replace it.


Read More

Posted by on Feb 22, 2013 in Blog, Computer Tips | 0 comments

Alienware M14x with Windows 8 – USB 3.0 ports and Corsair thumb drives issue


I have an Alienware M14x laptop and a few Corsair USB 3.0 thumb drives.  The thumb drives most of the time would not get recognized by Windows.  They throw an “unrecognized device” error when they are plugged in.  I can plug the same thumb drives into a USB 2.0 port on the same laptop and they work fine just not at USB 3.0 speeds which is not cool.  I can plug other USB 3.0 devices, like a Western Digital external hard drive, and they work just fine at USB 3.0 speeds.

After some searching I found some rather lengthy instructions here that fixed the problem perfectly for me and a co-worker with the same laptop.  Essentially the instructions walk you through getting Windows 7 drivers installed for the USB 3.0 hub and ports.

I imagine this applies to more than just the Alienware M14x and would work for other laptops as well.

Read More

Posted by on Jan 28, 2013 in Blog, Computer Tips, Microsoft Windows | 1 comment

Windows 7 domain user keeps logging on with temporary profile


I recently had a computer replaced on our domain.  For some reason the domain account I was working with kept logging into Windows with a temporary profile.  I tried numerous fixes found on the Internet to no avail.  Then I thought maybe it had something to do with the fresh load of Windows and I nuked the machine and started over.  Still not working right.  I figured it must be something to do with the domain account but couldn’t figure it out.

On a whim I compared domain accounts with another account and found the affected account was a member of the guests security group and the domain guests security group.
I removed the account from both groups and the problem went away.  Not sure how or when the account got added to those groups but the problem was solved by removing membership to them.

Read More

Posted by on Jan 24, 2013 in Blog, Computer Tips, Microsoft Windows | 0 comments

Easy way to block ads in Internet Explorer


One of the first things I do after installing Firefox is install ADBlock+ and then subscribe to a list.  Internet Explorer has had some addons that did the same sort of functionality for awhile but I found with IE9 and IE10 it’s even easier to block ads.  Open Internet Options and click the Programs tab.  Click the Manage Addons button.  Click “Tracking Protection” and then below that click “Get a Tracking Protection List online…”

That will take you to the Internet Explorer Gallery and there will be several different types of lists you can add.  I don’t recommend adding to many lists as this is likely to slow down your browser.  I added the Fanboy Adblock list.  I’ve read that the EasyPrivacy list put out by Easy List but I haven’t tried it yet.

I’ve used this on Windows 7 with IE9 and Windows 9 with IE10.  I haven’t looked to see if it’s in IE8 or below.

One thing to consider when adding ad blocking is that it can be taking revenue money from bloggers who rely on ads to provide free information.  That’s a decision I’ll leave up to you.

Read More

Posted by on Mar 30, 2012 in Blog, Computer Tips | 0 comments

HP P1102W prints a blank page then throws error

I’ve been using one of the HP P1102W laserjet printers.  It’s a great printer that supports iOS’s AirPrint as well as HP’s ePrint.

It periodically spits out a blank page and then the orange light (I assume it’s an error light?) starts flashing when I would print a document.

After some troubleshooting and a bit of mild anger (and a bit of help from a co-worker) the problem was narrowed down to when I printed a single page from a multiple page PDF.  The fix is in the Print dialogue box.  There’s a setting called “Print on both sides of paper” that was checked by default.  Unchecking that fixed my issue.  Some have mentioned clicking the “Advanced” button and selecting “Print as image” as a possible fix, but it didn’t work for me.

Read More

Posted by on Mar 9, 2012 in Blog, Computer Tips, Software | 0 comments

Copy Excel fields without changing formula

I had a row of formulas I wanted to copy to a separate row but retain the formulas as they were.
Excel wanted to change the formulas and update the cell references.
To keep it from doing this add a $ before the row and column reference.

So if a formula was =’4Q2011’!N6 meaning get the value from the 4Q2011 worksheet cell N6.
Make the formula =’4Q2011’!$N$6

This way when you copy it the formula will stay the same instead of what it was doing which was changing it to =’4Q2011’!N7


Read More

Posted by on Jan 29, 2012 in Blog, Computer Tips, iOS Tips | 4 comments

iPod Shuffle voice over doesn’t say the names of playlists

I picked up an iPod shuffle to use with my waterproof headphones for swimming.  They added a great feature to the shuffle that reads the names of songs, playlists and batterylife.  Since it does not have a screen to navigate by this comes in handy.  I set up the shuffle on my laptop loaded music and everything was working.  But then I decided to change computers I was putting music onto it with and then the voice over quit reading the playlist names.  It just said “Playlist 1, Playlist 2″  That’s not helpful.  Turns out the “Enable VoiceOver” setting was not checked on the computer I moved over to. Once I checked that in the Options section on the Summary page for the iPod shuffle in iTunes it started working again.

Update:  I thought I’d clarify that the iPod shuffle is not waterproof on it’s own.  I use the shuffle inside a waterproof case for swimming.  More about it here:

Read More

Posted by on Jan 14, 2012 in Blog, Computer Tips | 7 comments

Astaro security gateway and Netflix


I recently installed the Astaro security gateway firewall in my home. They offer it free to home users. It does an excellent job of protecting your home network. One of the downsides to firewalls is there’s always something that gets blocked that shouldn’t.  The issue I was having was with Netflix.  On tablets and home streaming devices I could not get Netflix to work even though I had told it to bypass scanning for streaming content. To fix it I added the following URls to the exceptions list and skipped all checks.


Read More

Posted by on Oct 31, 2010 in Blog, Computer Tips, Microsoft Windows, Software | 0 comments

Launch XBMC from Windows Media Center remote

I like Windows Media Center, but lately I’ve been liking XBMC more for streaming media to my TV. I bought a Roku player and love it, but (for now) there are things it doesn’t yet do that I want. Namely Hulu Plus (coming soon) and reliable, easy network streaming of my own content. PlayOn is not bad but just there yet for me plus it costs $49.99 plus $19.99 a year.
XBMC has an excellent interface and works well with streaming music and video from Windows shares.
I have a Windows Media Center remote that also works well with XBMC but the green button on it launches Media Center. A web search came up with Jacob Johnston’s blog who wrote a cool little tool for fixing this dilemma.
Get it here.
Jacob also has a launcher for Boxee if you prefer it to XBMC, available at the link above.

Read More

Posted by on Aug 11, 2010 in Blog, Computer Tips, Microsoft Windows | 0 comments

Using XCopy and excluding files and or directories

I use XCopy to back stuff up because it’s fast and easy.  Until you add 11,898 files you don’t want to actually backup.
So I set about trying to figure out how to exclude directories and or files from the XCopy routine.

It turned out to be pretty easy.

I basically have 2 text files.  RunBackup.cmd and MyExcludes.txt
They both reside in the same folder. 
The RunBackup.cmd text file has just the following line in it (all one line no line breaks):

xcopy /E /Y “C:\MySourceDirectory\subdirectory” “G:\MyDestinationDirectory\subdirectory\” /EXCLUDE:MyExcludes.txt

The MyExcludes.txt has the following line in it:


So this backs up everything in the source directory including subdirectories to the destination directory but excludes anything in a directory called \Storage and all sub-directories and files below that.

You can also put (each on a seperate line) things like:


That would do the same as above but also exclude any .doc and .pdf files from any directories in the source.
Tested on Windows 7 Professional.


Read More

Posted by on Oct 26, 2009 in Blog, Computer Tips, Microsoft Windows | 1 comment

attcm.exe “application failed to initialize properly (0xc00000005)” error trying to launch AT&T connection manager – Fix

After installing the software and drivers for our AT&T air card on a Windows XP machine I was unable to launch the connection manager.
Everytime I launched it we recieved an error message stating “application failed to initialize properly (0xc00000005).”
I tried un-installing and re-installing and downloading a newer version from their website all to no avail.
Finally after several Bing searches (yes I said Bing, not Google) and trying a few different “fixes” I had success.
I’m not sure which of the final 2 fixes actually did the trick but they were:
Open command prompt and type:   sfc /scannow
This causes the system file checker to run and fix any issues with system files.
I’m pretty sure that’s what fixed it but at the same time I also enabled and disabled the Data Execution Prevention setting under system properties/Performance/Data Execution Prevention tab.
By default it’s set to “Turn on DEP for essential Windows programs and services only” I changed it to “Turn on DEP for all programs and services except those I select:” hit apply, did not reboot and then changed it back and then rebooted.
After rebooting the AT&T connection manager launched but got hung.  I rebooted again and ever since it’s been working fine.

During the process I also ran to following 2 commands, I don’t think they helped but I put them here since I did it during the troubleshooting:
Note:  I vaguely understand what these do and don’t suggest you do this unless you know what you are doing:
CACLS %systemroot%\System32\*.dll /E /G BUILTIN\Users:R
CACLS %systemroot%\System32\*.ocx /E /G BUILTIN\Users:R

Read More

Posted by on Oct 15, 2009 in Blog, Computer Tips, Linux Tips and Tricks, Microsoft Windows | 0 comments

Add OSX to Fedora Grub triple boot of Windows 7, OSX and Fedora


I managed to get triple booting setup with OSX (iDeneb 10.5.7), Fedora 10 and Windows 7 on my Lenovo T400.

I did it by first installing Windows 7 then OSX next.  After the OSX install I couldn’t boot to Windows 7.
To fix this I booted onto the Windows 7 installation disk and selected repair then command prompt.
At the command prompt run diskpart.  At the diskpart prompt do the following:
list disk
select disk n (n is the disk where Windows is installed)
list partition
select partition n (n is the partition where Windows is installed)

Now Windows 7 should boot, if it doesn’t (and mine didn’t normally) boot onto the Windows 7 install again and select automated recovery of the boot area.
Windows 7 now boots and OSX doesn’t.  Install EasyBCD in Windows, this is used to edit the bootloader.  You can add the OSX in the Add/Remove entries section.
Save and reboot.  Now you should be able to dual boot Windows 7 and OSX.

The next step was to install Fedora 10 (I tried 11 but there was a bug that kept the partitioning tool from installing into the free space on my drive.)
After installing Fedora 10 I was able to dual boot into Windows 7 or Fedora but no OSX using the Grub bootloader.

Next we need to edit the Grub config file that controls what shows up on the menu.  Within Fedora open a terminal and type:
su and hit enter
Put in your root password
Next type:  sudo gedit /boot/grub/menu.lst
This opens the menu.lst file in a text editor.  The first thing I did was change the Windows option from Other to Windows 7 in the title field.
Next I added the following to get OSX into the menu:

title OSX
root (hd0,2)
chainloader +1

Now the root(hd0,2) you have to customize to your setup.  For mine the OSX partition was the 3rd partition on the drive so it ends up as hd0 (the first hard drive),2 (3rd partition starting at 0)

Save and reboot.  You now can triple boot Windows 7, Fedora and OSX.  In theory.
I also changed the default from 0 (Fedora) to 1 (Windows).  This way it automatically goes into Windows (my choice OS) if nothing is selected.

Read More

Posted by on Jul 5, 2009 in Blog, Computer Tips, Microsoft Windows | 0 comments

Firefox keyboard shortcuts

I posted these a couple of years ago and I found a few more to add to them:
Close a tab = Ctrl + W
New tab = Ctrl + T
Move to address bar = Ctrl + L
Move to Search engine box = Ctrl + K
Go to next Search engine = Ctrl + Arrow up or down
Open downloads tool = Ctrl + J
Add .com to address bar = Ctrl + Enter
Add .net to address bar = Shift + Enter
Add .org to address bar = Ctrl + Shift + Enter
Next Tab = Ctrl + Tab
Previous Tab = Ctrl + Shift + Tab
Find on this page = Ctrl + F

Read More