Monday, November 18, 2013

AJAXControlToolkit September release temporary bug solutions.

Issues:

1) MaskedEditValidator does not validate Mask in MaskedEditExtender properly for other CurrentThread cultures anymore.

2) BehaviorIDs on controls within UserControls that get used multiple times on a page, duplication issue.

3) Combine scripts not working in ScriptManager.


Specifiations:

Ajax Control Toolkit September 2013 Release

Version 4.5.7.1005


Temp Solutions:

1) You can just use the MaskedEditExtender without the MaskEditValidator. The mask should still handle cultures properly as long as you have EnableScriptGlobalization="true" set on your ScriptManager and both CurrentCulture and CurrentUICulture set as well.


2) You can simply delete the BehaviorIDs on those controls used more than once on the page, hopefully you don't need that id client side.

3) Unfortunatly combine scripts must be set to false in ScriptManager for the time being. And yes this will cause more scripts requests and a slower page load time.

Thursday, August 22, 2013

Firebug SyntaxError: syntax error DOCTYPE

Issue:

Firefox firebug is showing an error similar to the following:
SyntaxError: syntax error  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//E



Solution:

It's actually because onr of your script references cannot be found and is getting a 404.

Check for a typo in your src path, a mistake in your relative path folder location, or an external reference not existing anymore.
    <script src="something wrong here"></script>


Tuesday, July 2, 2013

Installing the MCR in Silent Mode


Issue:

The installation fails because it cannot get past the license agreement.


Specifications:

Installing the MCR Non-Interactively (Silent Mode)

To install the MCR without having to interact with the installer dialog boxes, use one of the MCR installer non-interactive modes: silent or automated.

Version: MCR v8.1
Release: R2013a
Platform: win64


Solution:

Steps to test what is to be a future automated silent installation.
  1. Download the MCR compiler exe. The msi doesn't exist anymore.
  2. Rename to .zip and extract.
  3. Run setup from command prompt with admin privileges.
          setup.exe location:
          MCR_R2013a_win64_installer\bin\win64

          command:
          setup.exe -mode silent -agreeToLicense yes

          **you need the agreeToLicense command or it will get stuck and fail**

         logs:
         Logs can be found in C:\Users\YourUser\AppData\Local\Temp
         mathworks_YourUser.log


Log errors:

When running the installer with an input file, you must accept the license agreement by setting the agreeToLicense option to yes.
Exiting with status -1
End - Unsuccessful


For future automation:
  • Some folders are useless for placing the zip in storage, to unzip, and run your automated installation scripts. They include: help, utils, and files in the root called install_guides.

Side notes:

Location of mclmcrrt8_1.dll:
C:\Program Files\MATLAB\MATLAB Compiler Runtime\v81\runtime\win64

Tuesday, May 7, 2013

Multiple subsequent OrderBy's with Lambda Expressions

Issue:

Perform multiple subsequent nested OrderBy's with a Lambda Expressions similar to LINQ's  orderby.


from u in db.Users
orderby u.LastName, u.FirstName
select u;


Solution:

userList.OrderBy(u => u.LastName).ThenBy(u => u.FirstName);

Friday, January 25, 2013

SQL - Convert SQL Column to Camel Case

Issue: Converting a sql column comprised of strings into camel casing format.

Solution: Create a camel casing function, run it against the column, and delete the function if you like afterwards.

 1)
CREATE FUNCTION [dbo].[CamelCase]
(@Str varchar(8000))
RETURNS varchar(8000) AS
BEGIN
  DECLARE @Result varchar(2000)
  SET @Str = LOWER(@Str) + ' '
  SET @Result = ''
  WHILE 1=1
  BEGIN
    IF PATINDEX('% %',@Str) = 0 BREAK
    SET @Result = @Result + UPPER(Left(@Str,1))+
    SubString  (@Str,2,CharIndex(' ',@Str)-1)
    SET @Str = SubString(@Str,
      CharIndex(' ',@Str)+1,Len(@Str))
  END
  SET @Result = Left(@Result,Len(@Result))
  RETURN @Result
END

2)
Update SomeTable Set SomeName = dbo.CamelCase(SomeName)