AngularJS 1.x url case sensitivity

In case you didn’t know the routes that configured using UI-Router are case-sensitive.  Which is definitely not what I would expect. To get around this problem you can add a snippet of code to the _Layout.cshtml page (in the body tag).

<!– The following code fixes a AngularJS case sensitivity issue –>
<!– by replacing the base.href with the location.href –>

<script type=”text/javascript”>

(function () {

var base = document.querySelector(“base”);

var normalized = RegExp(base.href, “i”).exec(location.href);

base.href = normalized ? normalized[0] : base.href;

}());

</script>

Advertisements

How to tell what processes are running on your SQL Server database

Sometimes operations (like drop, etc) will fail on your DB if someone running a command and locking a resource.

So I came up (or found somewhere) a query to tell me what’s currently running.

SELECT P.spid as SPID, P.kpid as KPID, P.dbid as DBID, D.name, convert(varchar, P.last_batch, 5) as StartDate, convert(varchar, P.last_batch, 8) as StartTime,
P.hostname as HostName, P.nt_domain as Domain, P.nt_username as Username,P.cmd as Command, P.waitresource, P.status as [Status],P.cpu as CPU,P.memusage as MEM,P.physical_io as IO
FROM sys.sysprocesses P
JOIN sys.databases D
ON P.dbid = D.database_id
ORDER BY D.name, P.cpu

This will return all the processes, sometimes you just want the processes for a specific user.  Then you just need to add a where clause.

WHERE nt_username = ‘<username>’

Live Mesh sync error

I was using live mesh to sync my favorites, and some folders.  I had to switch live mesh accounts and when I tried to use mesh with my new I got the following error
“This folder can’t be synced. It is already being synced, contains folders that are already being synced, or is in a folder that is already being synced. Please select a different folder or move this folder to another location.”

In order to solve this I deleted everything I could from the directory C:\users\<MYUSERNAME>\AppData\Local\Microsoft\Windows Live Mesh

Then I stopped and restarted live mesh.  Then I had to setup what was synced, but I had no trouble after that.

So you want to blog on asp.net

When I first started blogging I wanted to blog on asp.net.  I have a friend who already blog’s on asp.net (David Mccollough) and I asked him what the steps were (because they are not on asp.net).

Here is what he told me.

Well it’s a multistep process.

1st you have to create an account to be able to login, which I assume you have already done.

2nd you have to read the terms of use here.  http://www.microsoft.com/info/cpyright.mspx. By the way there is nothing you have to sign here, unless they have changed it. I was kinda of confused at first, because I was looking for some way of saying that I had read them.

3rd Then you have to send an email to Joe Stagner, here is the link for that: http://www.misfitgeek.com/Email.aspx Make sure you tell him that you agree to the terms of use that you read in step 2, you also have to send him your username from step 1. I think I also included who I was, who I worked for and that I had a desire to contribute to the .NET community.

4th Before you first post you need to read this: http://www.misfitgeek.com/WeblogsaspnetNewBloggerFeedGrowth.aspx

Here is the original link to his blog post that outlines the process: http://www.misfitgeek.com/2008/06/16/JoinUsWithABlogOnWeblogsaspnet.aspx

Tweet from Outlook

Outlook is the one application I have open all day long.  I don’t like most twitter apps.

So I was happy to find an add-in for outlook that will tweet for you.  It can stuff all your new tweets in a folder (or your inbox) and you can save everything you tweet in a folder (like sent mail)

If puts a new toolbar in Outlook.

image

 

 

Here is the link

http://www.techhit.com/TwInbox/twitter_plugin_outlook.html

Community Credit, live writer plug in

A coworker of mine (David Mccollough) told me about Community Credit.  You use the website to track how your giving back to the developer community, ex. any blog posts or presentations you give at user groups, etc.

There is also a live writer plug-in, so when your posting it automatically updates Community Credit.

Here is the link that explains how to install the plug-in for 32 bit windows.

If you have 64 bit windows the path to the plug-in directory is “C:\Program Files (x86)\Windows Live Writer\Plugins”.

Get Google results that matter

More than once I have searched for something on Google and gotten back too many results that don’t matter.  One of the problems with IT is that everything moves and improves quickly.  It’s such a pain when get results that over 2 years old and don’t matter because the technology has moved on.

Use the advanced search of Google to get results that are relevant.  You can tell Google what date range to use (how recent the page is), for example past week, past month, past year.  That way you will only get pages in the results that are from the your date range.  This helps when you’re working with bleeding edge technologies.