How can I know when SQL Full Text Index Population is finished?

When you execute some queries on your SQL Server, are you sure the catalog is being imported? With this simple script you can know which is the Index status. DECLARE @CatalogName VARCHAR(MAX) SET @CatalogName = ‘TEST_FullIndex’ SELECT FULLTEXTCATALOGPROPERTY(@CatalogName,’ItemCount’) as NumberOfItems, FULLTEXTCATALOGPROPERTY(@CatalogName,’ImportStatus’) as ImportStatus, DATEADD(ss, FULLTEXTCATALOGPROPERTY(@CatalogName, ‘PopulateCompletionAge’), ‘1/1/1990′) AS LastPopulated, (SELECT CASE FULLTEXTCATALOGPROPERTY(@CatalogName,’PopulateStatus’) WHEN 0 THEN ‘Idle’ WHEN 1 THEN ‘Full Population In Progress’ WHEN 2 THEN ‘Paused’ WHEN 3 THEN ‘Throttled’ WHEN 4 THEN ‘Recovering’ WHEN 5 THEN ‘Shutdown’ WHEN 6 THEN ‘Incremental Population In Progress’ WHEN 7 THEN ‘Building…

Read More

How To Enable SQL Full Text Indexing

The following steps will tell you if your database version supports full text searching and if so how to enable it. Open SQL server management console Right click on the database and select properties On the left select files If “Full-Text Indexing” is greyed out it means that full-text indexing is not enabled. NOTE: If you are using SQL Server 2012 Please see the SQL Server 2012 notes at the bottom of this article. How to enable Full Text Searching Click on the New Query button top left of the…

Read More

How to remove HTML tags from data with SQL

The purpose of this article is to provide a way of cleaning up of HTML tags within the data. When we use various styles or tabular format data in UI using Rich Text Editor/ Rad Grid etc, it will save data in database with HTML tags. When you save in database this kind of field you have: An HTML element starts with a start tag (<p>) and ends with end tag (<p/>) and everything between Start tag and End tag is HTML element. e.g. <b>Following are the popular databases: <br…

Read More

SQL SERVER – Find Current Location of Data and Log File of All the Database

As I am doing lots of experiments on my SQL Server test box, I sometime gets too many files in SQL Server data installation folder – the place where I have all the .mdf and .ldf files are stored. I often go to that folder and clean up all unnecessary files I have left there taking up my hard drive space.  I run following query to find out which .mdf and .ldf files are used and delete all other files. If your SQL Server is up and running OS will…

Read More

How to strip all HTML tags and entities and get clear text?

I was encouraged to write this Tip/Trick because of so many questions received for this issue. Suppose you’re having a bunch of HTML strings, but you just want to remove all the HTML tags and want a plain text. You can use Regex to come to the rescue. The Regex I had developed before was more cumbersome, then Chris made a suggestion, so I will now go further with the regex suggested by Chris that is a "\<[^\>]*\>". I have tested it for many cases. It detects all types of…

Read More

Microsoft Announces Office 2016 Will Arrive September 22

Microsoft announced this morning the official launch date for the long-anticipated new version of Microsoft Office: Office 2016 will be broadly available starting on September 22, the company says. Meanwhile, Office Customers with volume licensing agreements will be able to download the software on October 1st. The updated version of Office includes a number of new features for desktop customers, including the ability to co-edit documents at the same time, sync files to OneDrive in the cloud, and more. Alongside the announcement of the launch date, Microsoft noted a few…

Read More

Track events for Google Analytics and Piwik

After my post of yesterday, I’ve worked for creating a script to integrate Google Analytics (new version with analytics.js) and Piwik (Piwik is the leading open-source analytics platform similar to Google Analytics. You can download it from its site or directly in your IIS with WebMatrix). With this code you have only one function to call in every part of your page. Automatically the function detects download, email, phone number, external links and tracks them. You can insert in an anchor a code like: <a href=”https://puresourcecode.com/” onclick=”TrackEvent(‘Link to my site’, ‘PSC’,…

Read More

Templated Razor Delegates

What’s that? I’ll let the code do the speaking. @{ Func<dynamic, object> b = @<strong>@item</strong>; } <span>This sentence is @b(“In Bold”).</span> That could come in handy if you have friends who’ll jump on your case for using the bold tag instead of the strong tag because it’s “not semantic”. Note that the delegate that’s generated is a Func<T, HelperResult>. Also, the @item parameter is a special magic parameter. These delegates are only allowed one such parameter, but the template can call into that parameter as many times as it needs.…

Read More

Creating reusable HTML components in ASP.NET MVC using Razor

Whilst working on a side project I started to notice I was using a lot of the same HTML to create floating boxes. Whilst these boxes looked the same, the content of them changed quite dramatically; for instance, some of the content boxes contained forms, others contained straight text, like so: <div class="panel"> <div class=panel-inner"> <h2 class="panel-title">Panel Title</h2> <div class="panel-content"> /* Can I pass content to be rendered in here here? */ </div> </div> </div> </div>   As my side project progressed and grew, I found myself making more and…

Read More

ASP.NET: The data protection operation was unsuccessful

the data protection operation was unsuccessful. this may have been caused by not having the user profile loaded for the current thread’s user context, which may be the case when the thread is impersonating. If you receive this error from one of your application, you resolve the problem in this way: Open IIS Manager Select Applications Pools, and go ahead and select the App Pool used by your app Right-click on it, and select Advanced Settings, Go to the Process Model Section and Find the “Load User Profile” Option and…

Read More

Microsoft’s Windows 95 is 20-years-old today

When Microsoft kicked off work on Windows 95 way back at the beginning of the 90s, the company wasn’t to know how much of an impact it would have on our lives two decades on. In one fell swoop the new version of Microsoft’s OS brought a swish graphical user interface (GUI) to desktops for the first time and the much vaunted Start menu began life inside the mid-1995 edition of the OS. You only need look at the disquiet that surrounded its removal from Windows 8 and subsequent return…

Read More

Visual Studio 2015: upgrade all NuGet packages at one time

Open the Package Manager Console and use the Update-Package cmd-let to update all packages. If this doesn’t work, you have other two solution. Always in Package Manager Console you type one of those: First solution $list = Get-package -project {Add project name here} for($i=0; $i -lt $list.Length;$i ++ ) { Update-Package -project {Add project name here} $list[$i].Id } Replace {Add project name here} with your project name without braket Second solution foreach ($p in get-project -all) { update-package -ProjectName $p.ProjectName }   Happy coding!

Read More

How to truncate log file in SQL Server

In SQL Server data is stored using two physical files: (.mdf) extension which contains the data. (.ldf) extension which contains log. Log file size increases very rapidly and depend on the operation performed on the data. After a long time period this file becomes too large. When log file is too large it takes time to perform some operations like (attach, de-attach, backup, restore… etc ). Step 1. Copy/type the below given SQL. Step 2. Change @DBName to <Database Name>, @DBName_log to <Log File Name> Step 3. Execute the SQL.…

Read More

UWA: This application can only run in the context of an AppContainer

C# .NET language

Run it from VS (with or without debugging). This will actually install unpackaged version of your app, so you will see it in the start screen. Create a package to use locally. You can do this in VS by going to Store → Create App Package → Build a package to use only locally. This will create a bunch of files, including a command-line script that will actually install the app. You probably could use this method to distribute the app, but it would work only on developer-enabled computers. Publish…

Read More

Microsoft now has six million Windows Insiders

In a video posted earlier (see it below), Microsoft CEO Satya Nadella once again accepted the challenge of former NFL player Steve Gleason, who suffers from ALS, and poured a bucket of ice cold water over his head along with Terry Myerson and members of the Windows 10 team. At the same time, Myerson, head of the Windows and Devices division, confirmed that six million have signed up to the Windows Insider program that sees users able to test preview releases of Windows 10 and Windows 10 Mobile, according to Windows…

Read More

Universal Windows app samples

windows store universal windows platform

On GitHub Microsoft have published a lot of examples for Universal Apps: the link is https://github.com/Microsoft/Windows-universal-samples This repo contains the samples that demonstrate the API usage patterns for the Universal Windows Platform (UWP) in the Windows Software Development Kit (SDK) for Windows 10. These code samples were created with the Universal Windows templates available in Visual Studio, and are designed to run on desktop, mobile, and future devices that support the Universal Windows Platform. Universal Windows Platform development These samples require Visual Studio 2015 and the Windows Software Development Kit…

Read More

Windows 10: Changing Paradigms

Windows 10 is the main discussion topic in the online development communities. This new operating system that is currently in the technical preview (and available through the Microsoft insider program) is a milestone in the platform unification journey that Microsoft embarked upon with starting with Windows Phone and Windows 8 operating systems. With Windows 10, developers and users are introduced to one development kit, one store, one application and one binary distribution package. Introducing Windows Core With Windows 10, developers are introduced to the new Windows Core concept. Windows Core…

Read More

Windows 10 uses peer-to-peer networking to distribute updates by default

Now that Windows is a service (WaaS), which means it will constantly be updated rather than have big regular updates, Microsoft has put some features in to Windrows 10 to speed up the delivery of those updates. One feature that may have escaped your notice is called Windows Update Delivery Optimization (WUDO). This feature isn’t mentioned in the "Get Started" app but needs to be searched for in the documentation. This new Windows 10 feature works in a similar way to torrent technology which uses a peer to peer network…

Read More

Crypt and decrypt your email with JavaScript

If you want to publish an email on your site but you want to protect it, I have a simple solution   HTML <!DOCTYPE html> <html xmlns="https://www.w3.org/1999/xhtml"> <head> <title></title> <script src="crypto.js"></script> <script src="uncrypto.js"></script> </head> <body> <h1>JavaScript eMail Encrypter</h1> <p>You can encrypt mailto: links on a website, so that spiders can’t detect them, with a simple javascript.</p> <p>Example: <a href="javascript:linkTo_UnCryptMailto(‘nbjmup;spttjojAftjb/dp’);">rossini [at] esia [dot] co</a></p> <form> <div> <div class="container"> <div class="desc">enter your eMail address:</div> <div><input type="text" name="emailField" size="40" maxlength="255" /></div> </div> <div class="container"> <div class="desc"><input type="button" name="ecrypt" value="Crypt eMail Address" onclick="CryptMailto()" /></div>…

Read More

Classical Inheritance in JavaScript

JavaScript is a class-free, object-oriented language, and as such, it uses prototypal inheritance instead of classical inheritance. This can be puzzling to programmers trained in conventional object-oriented languages like C++ and Java. JavaScript’s prototypal inheritance has more expressive power than classical inheritance, as we will see presently. Java JavaScript Strongly-typed Loosely-typed Static Dynamic Classical Prototypal Classes Functions Constructors Functions Methods Functions But first, why do we care about inheritance at all? There are primarily two reasons. The first is type convenience. We want the language system to automatically cast references…

Read More

Apple Pay Has Officially Launched In The U.K.

The Eagle has landed. An accidental tweet told us that the U.K. wouldn’t have to wait for Apple Pay much longer, and that tweet was right. Apple Pay has officially launched in the U.K. Finally! It has been available to customers here in the US since last October, so your time has finally come, U.K. Hopefully your bank is one of the launch participants: American Express, First Direct, HSBC, Nationwide, NatWest, Royal Bank of Scotland, Santander and Ulster Bank. I use Simple as my bank and had to wait until…

Read More

Delete all Stored Procedures at once

If this is a one- time task, just open Object Explorer, expand your database > programmability and highlight the Stored Procedures node. Then turn on Object Explorer Details. On the right you should see your list, and here you can multi-select – so you can sort by name, choose all procedures that start with aspnet_, and delete them all with one keystroke. If you are doing this repeatedly, then (assuming your procedures are all in the dbo schema): DECLARE @sql NVARCHAR(MAX) = N”; SELECT @sql += N’DROP PROCEDURE dbo.’ +…

Read More