Fixing Google Chrome 39 update error: Update failed (error: 7)

When updating Google Chrome 39 64 bit on Windows 8.1 I was getting the error:

Update failed (error: 7) An error occurred while checking for updates: Google Chrome or Google Chrome Frame cannot be updated due to inconsistent Google Update Group Policy settings. Use the Group Policy Editor to set the update policy override for the Google Chrome Binaries application and try again; see http://goo.gl/uJ9gV for details.

 

To solve this problem:

  • Close all Google Chrome instances
  • Start > Run > regedit
  • Find and open HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Update\

If you have the following values listed under the above key then all attempts to update Google Chrome and/or Google Chrome Frame will fail:

  • Update{8A69D345-D564-463C-AFF1-A69D9E530F96}
  • Update{8BA986DA-5100-405E-AA35-86F34A02ACBF}

In my case it was only: Update{8A69D345-D564-463C-AFF1-A69D9E530F96}

After removing this registry key and restarting Google Chrome I was able to update to Chrome 40

How to fix: No gulp tasks found by the Task Runner Explorer in Visual Studio 2013

The Task Runner Explorer extension for Microsoft Visual Studio 2013 found the gulpfile.js in my project, but the task in that file where not listed, just beneath the gulpfile.js, (No tasks found) was displayed, this was caused by missing dependencies.

image

 

To fix this:

Just open a command prompt.

Change directory to the folder containing the file “gulpfile.js”

Then enter: npm install

All dependency for gulp should be installed, now when you op the project in Visual Studio 2013 the tasks should be shown.

 

image

How to validate an entered text to a min date in a kendo datepicker in AngularJS.

The code and live preview can be found here:

http://plnkr.co/edit/jdnRjO?p=preview

 

When no date is entered a “pink” border will be shown:

image

 

When a date is entered that’s before the “min” date a “pink” border will be shown:

 

image

 

When a date on or after the min date is entered, no border will be shown:

 

image

How to rename an user in Active Directory with C#

 

If you want to rename an user in Active Directory by using C#, you can use the following code:

using System;
using System.Collections.Generic;
using System.DirectoryServices;
using System.DirectoryServices.AccountManagement;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
try
{
Console.WriteLine("This application will rename a user in active directory.");
Console.WriteLine(Environment.NewLine);
Console.WriteLine("Enter domain:");
string domain = Console.ReadLine();
Console.WriteLine("Connecting to domaincontroller.");
using (PrincipalContext context = new PrincipalContext(ContextType.Domain, domain))
{
if (context == null)
{
throw new ApplicationException("Domain not found.");
}
Console.WriteLine("Enter current username (e.g. john):");
string currentUserName = Console.ReadLine();
using (UserPrincipal user = UserPrincipal.FindByIdentity(context, currentUserName))
{
if (user == null)
{
throw new ApplicationException("User not found.");
}
Console.WriteLine("Enter new username (e.g. john2):");
string newUserName = Console.ReadLine();
using (DirectoryEntry entry = (DirectoryEntry)user.GetUnderlyingObject())
{
Console.WriteLine("Setting account properties in active directory.");
entry.InvokeSet("uid", newUserName);
entry.InvokeSet("sAMAccountName", newUserName);
entry.InvokeSet("userPrincipalName", string.Format("{0}@{1}", newUserName, domain));
entry.CommitChanges();
Console.WriteLine("Rename common-name (CN).");
entry.Rename("CN=" + newUserName);
entry.CommitChanges();
Console.WriteLine("User successfully renamed.");
}
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
Console.WriteLine("Press enter to continue...");
Console.ReadLine();
}
}
}

Using a custom AngularJS validation directive to validate an entered text in a kendo combo box.

See the plunker for the code: http://plnkr.co/edit/WroQIwLj4K8vUlVOCkDx?p=preview

 

When no text is entered, the kendo combo box should be invalid:

image

 

When a text is entered, that does not match a valid entry, the kendo combo box should be invalid:

 

image

 

When a text is entered, that does match a valid entry, the kendo combo box should be valid and the selected person should be shown:

 

image