Monday, 23 February 2015

Windows 7 Weather Gadget: Cannot connect to service issue

Please follow this to fix the issue.

  1. Go to %localappdata%\Microsoft\Windows Live\Services\Cache
  2. Open "Config.xml" , Right click on it Select Edit, it will open in Notepad.
  3. Click on File>> Save (without doing any changes)
  4. Restart the Gadget after a Minute and it should start working.

However, it may be a temporary fix.  Many (myself included) report the problem returning. 

(Note: This fix appears to work, even if you're testing in IE10 with ActiveX settings as follows, using this code here http://jsfiddle.net/4aww6o3t/

and you get the Access is denied error from the call to oMSN.GetService("weather")

image

try
{
    // Connect to Weather Service .dll
    var oMSN = new ActiveXObject("wlsrvc.WLServices");
    var oMSN2 = new ActiveXObject("wlsrvc.WLServices");
    this.oMSN = oMSN.GetService("weather"); // Object to send and recieve weather data queries and to poll for service existence
    this.oMSN2 = oMSN2.GetService("weather"); // Object to send a latlong query and recieve a location code corresponding to the latlong
}
catch (objException)
{
    this.isValid = false;
    this.statusMessage = getLocalizedString('ServiceNotAvailable');
    this.oMSN = new Object();
    this.oMSN2 = new Object();
}

Tuesday, 17 February 2015

Default Notepad++ to XML language sytnax highlighting for .config files

On the Notepad++ menu bar, click "Settings" -> "Styler Configurator..."

image
- Under "Language", select "XML"
- Under "User ext", type in "config".  While we're at it, let's also type in (space delimited) "aspx", "ascx", and "master".
- Click "Save & Close"

That's it!  Now when you view config files, ASP.NET pages, user controls, or master pages in Notepad++, you'll get syntax highlighting.

More about this here... http://www.mattblodgett.com/2007/11/notepad-tip-syntax-highlighting-for.html

Monday, 16 February 2015

TFS Http 404 not found error

If you get an HTTP 404 not found error when connecting to TFS

clip_image002

Delete all the files in this folder

%userprofile%\AppData\Local\Microsoft\Team Foundation\4.0\Cache

You also may receive an error message in the VS 2013 output window, reading as follows...

We were unable to automatically populate your Visual Studio Online accounts.

The following error was encountered: One or more errors occurred.TF205020: Could not connect to server ‘tfs.russellreynolds.com\DefaultCollection’. This server was used in your last session, but it might be offline or unreachable. Confirm that the server is available on the network. To attempt to connect again, or to a different server, click ‘Connect To Team Foundation Server’ in Team Explorer or the Team menu.

The server returned the following error: HTTP code 404: Not Found

Wednesday, 11 February 2015

Resharper running slowly

Just found a neat trick for speeding up the Ctrl+T navigation slowness against my solution with JetBrains Resharper 8.2

1. Clean out your cache folder for the solution...

%userprofile%\AppData\Local\JetBrains\ReSharper\v8.2\SolutionCaches

2. Resinstall Resharper

Monday, 2 February 2015

MVC / Jquery unobtrusive validation

http://www.devtrends.co.uk/blog/the-complete-guide-to-validation-in-asp.net-mvc-3-part-1

Also for how do attach a new client side method to unobtrusive validation e.g.

jQuery.validator.unobtrusive.adapters.add(adapterName, [params], fn);

see this article...

http://bradwilson.typepad.com/blog/2010/10/mvc3-unobtrusive-validation.html

 

Note: For any element a in your <form>, you can do this to figure out what validation is attached to the containing <form> for that element...


$.data(a.form, "validator").settings.rules

e.g.

$.data(a.form, "validator").settings.rules.MiddleInitial
Object {maxlength: "1", __dummy__: true}

$.data(a.form, "validator").settings.messages.MiddleInitial
Object {maxlength: "The middle initial must be a single charater"}

Wednesday, 14 January 2015

How to do data dash data- attributes in Razor

Answer: Use an underscore

In the cshtml view file definition when declaring the attributes in the new {} object class for the attributes, use data_mycustomdataattribute to render out data-mycustomdataattribute

@Html.Hidden("controlName", "valueHere", new { @data_mycustomdataattribute = "testing dash"})

This will render the following...

<input data-mycustomdataattribute="testing dash" id="controlName" name="controlName" type="hidden" value="valueHere">

Friday, 19 December 2014

How to connect to LDAP with Jabber

Edit the following file

%userprofile%\AppData\Roaming\Cisco\Unified Communications\Jabber\CSF\Config\jabber-config-user.xml

add following information to file

 

<?xml version="1.0" encoding="utf-8"?>

<config version="1.0">

 

<Directory>

<DirectoryServerType>EDI</DirectoryServerType>
   <PrimaryServerName>russellreynolds.com</PrimaryServerName>
   <ServerPort1>389</ServerPort1>
   <SecondaryServerName>russellreynolds.com</SecondaryServerName>
   <ServerPort2>389</ServerPort2>
   <UseSSL>0</UseSSL>
   <UseSecureConnection>0</UseSecureConnection>
   <UseWindowsCredentials>0</UseWindowsCredentials>
   <ConnectionUsername>CN=Merrick Chaffer,OU=Elevated Users and Computers,OU=Users and Workstations,DC=RussellReynolds,DC=com</ConnectionUsername>
   <ConnectionPassword>***EnterPasswordHere***</ConnectionPassword>
   <SipUri>mail</SipUri>
  
   <DomainName>russellreynolds.com</DomainName>
   <BaseFilter>(&amp;(objectCategory=person))</BaseFilter>
   <UserAccountName>mail</UserAccountName>
  


    <ConnectionType>1</ConnectionType>
  
   <BDIPrimaryServerName>russellreynolds.com</BDIPrimaryServerName>
  
   <BDIServerPort1>389</BDIServerPort1>
  
  
   <BDIConnectionUsername>CN=Merrick Chaffer,OU=Elevated Users and Computers,OU=Users and Workstations,DC=RussellReynolds,DC=com</BDIConnectionUsername>
  
   <BDIConnectionPassword>***EnterPasswordHere***</BDIConnectionPassword>
  

<SearchBase1>ou=users and workstations,dc=russellreynolds,dc=com</SearchBase1>

<BusinessPhone>ipPhone</BusinessPhone>

</Directory>

 

<Policies>

<EnableBFCPVideoDesktopShare>true</EnableBFCPVideoDesktopShare>

<File_Transfer_Enabled>false</File_Transfer_Enabled>

<EnableVideo>false</EnableVideo>

<enableLocalAddressBookSearch>true</enableLocalAddressBookSearch>

</Policies>

 

<Options>

<Start_Client_On_Start_OS>true</Start_Client_On_Start_OS>

</Options>

 

 

</config>