\b[0-9]*:I used this today for removing line numbers from code a snippet I copied off of a web page.
Wednesday, June 13, 2012
RegEx: Remove Line Numbers
Found this Regex to replace any line starting with one or more numbers followed by colon -
Thursday, May 31, 2012
NuGet Package Restore Tips
I recently have started using the NuGet Package Restore option in all of my .NET projects. This is a great new feature that was enabled with NuGet version 1.6. I followed this blog post Cleaning Up Your Git Repository for NuGet 1.6 and saw my repository size shrink drastically, a very good thing.
However, I noticed that when I enabled Package Restore that Git was excluding my NuGet.exe file in the solution .nuget folder. This was based on my having a *.exe entry in my .gitignore file. I was able to manually add the file by issuing the command git add -F NuGet.exe from the git command line. This worked but I wanted to find a better way. I tried a few different entries in the .gitignore file unsuccessfully. Then today, I had this issue again and did some more research and found this Answer on StackOverflow about putting an additional .gitignore file in the .nuget folder and explicitly including all executables via a !*.exe line. This worked great.
However, I noticed that when I enabled Package Restore that Git was excluding my NuGet.exe file in the solution .nuget folder. This was based on my having a *.exe entry in my .gitignore file. I was able to manually add the file by issuing the command git add -F NuGet.exe from the git command line. This worked but I wanted to find a better way. I tried a few different entries in the .gitignore file unsuccessfully. Then today, I had this issue again and did some more research and found this Answer on StackOverflow about putting an additional .gitignore file in the .nuget folder and explicitly including all executables via a !*.exe line. This worked great.
Friday, May 18, 2012
How to get Application Version
Ever need to the the version of your application? For example showing the version of a executable (a console application, for example). Then you can do that with a single line of code
Assembly.GetExecutingAssembly().GetName().Version
Please note that Version is of the type System.Version that contains properties for the major and minor revisions and others if needed.
Assembly.GetExecutingAssembly().GetName().Version
Please note that Version is of the type System.Version that contains properties for the major and minor revisions and others if needed.
Thursday, May 10, 2012
IIS Application Pool Identity access to SQL Server
I recently had a need to connect to a SQL Server Express 2008 R2 instance using the 'Integrated Security=SSPI" option in my connectionString setting. Of course when I ran the site the first time, I got an error stating that IIS APPPOOL\{MyApplicationPoolName} could not access the database. So after a little searching, I found this post ApplicationPoolIdentity IIS 7.5 to SQL Server 2008 R2 not working. on the IIS Forums that provided the proper steps to grant the Application Pool Identity access to the database.
The necessary steps from the post are below for reference.
In SQL Server Management Studio ...
The necessary steps from the post are below for reference.
In SQL Server Management Studio ...
- connect to your SQL Server and navigate to Security - Logins in Object Explorer.
- Add a new login:
- Create a Windows login with the name of your application pool. Use the virtual domain name "IIS AppPool", like: "IIS AppPool\{YourApplicationPoolName}"
(Dont' forget to use the real application pool name after the backslash, e.g.: "IIS AppPool\DefaultAppPool") - Assign the new login to your database(s) in the User Mapping page of the New Login dialog.
Give it any user name you find appropriate. - Save and close the New Login dialog.
- In Object Explorer ...
- Navigate to your database, then navigate to Security - Users
- Navigate to your new user and set permissions according to your needs.
Monday, April 30, 2012
Solr 3.6
I am excited to see the latest improvements that are now available in Solr 3.6. Please see the following links for more details about the latest release:
- Lucene / Solr 3.6 Released - Blog post by the Solr Project Manager - Robert Muir
- Solr 3.6 Release Notes
For me the I am most looking forward to the improved HtmlStripCharFilterFactory and improvements to the FST based Suggesters.
Monday, January 23, 2012
TFS Compare Tool
The very first thing you should do before starting to use the TFS explorer, is to replace the Diff/Compare Tool. The one that comes with Visual Studio is pretty bad. Here is a good blog post - Replacing the TFS Diff Tool that shows how to quickly setup a new tool.
I prefer to use SourceGear DiffMerge, but you can use whatever you like. Just, please do yourself a favor and change it to something other than the default.
I prefer to use SourceGear DiffMerge, but you can use whatever you like. Just, please do yourself a favor and change it to something other than the default.
Wednesday, August 17, 2011
Following Open Source via RSS
I have recently been working on an ASP.NET MVC project, where I have included many Open Source projects. Most of them were included using NuGet (a great tool by the way, you should get it if you don't already have it!). So, for a lot of these open source projects that I an now using, I like to keep track of what changes are happening in the projects. A great way that I have found to do this, is to track the commits to the projects via RSS. I have subscribed to the RSS feed of the commits for the projects in Google Reader and then grouped them into an OpenSource folder that I can monitor. For me, this is a really easy way to see what is happening on a project and to watch out for interesting updates.
Subscribe to:
Posts (Atom)