Wednesday, November 28, 2012

Could not load file or assembly 'blah'

or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.


I had this with a WCF service in which there were 2 dll's in the bin  , 1 a backup copy of the other.


At a later date I had this when there was some kind of conflict with supporting dll's so I just comepletely deleted the bin and got the supporting dll's from my development bin

IP to machine name




C:\>nbtstat -a n.n.n.n


Monday, November 26, 2012

'RSClientController' is undefined

I had to change the app pool managed pipeline to classic

Unformattable dates in s/sh gear and excel

if you enter a value such as "123456789" in excel and format it to a date - excel cannot show it so it displays "######################". If you save to csv , excel will save "######################". spreadsheetgear will save nothing to csv.

Tuesday, November 20, 2012

Monday, November 12, 2012

Chrome anomoly

event.srcElement.isContentEditable or event.target.isContentEditable was always returning false, even though it existed.


JQuery test for existance



if ($("#blah").length > 0) {


what confounds me  is the following failed



if ($("#blah ")[0].length > 0) {

just like JQuery will create an empty object with 0 length in case the object does not exist shouldn't it be referenced at [0]?

Chrome js debugger

does not loo through jquery's each

this was painful learning experience for me

Thursday, November 8, 2012

Color issues

I thought my code for alternate row colors was faulty - or a cascading issue.
In reality - my screen doesn't show the color

e.g. #f6f6f6 

IE9

tools-> compatibility view settings ->intranet by default is on

regardless of setting you can set the web page with the following meta

<meta http-equiv="X-UA-Compatible" content="IE=8" />

Monday, November 5, 2012

Basic linq syntax group by on datatable



            DataTable dt = new DataTable();
            dt.Columns.Add("a", typeof(string));
            dt.Columns.Add("b", typeof(string));
            dt.Columns.Add("c", typeof(string));
            DataRow dr =  dt.NewRow();
            dr[0] = "a - row1";
            dr[1] = DBNull.Value;
            dr[2] = "c -row1";
            dt.Rows.Add(dr);
            dr = dt.NewRow();
            dr[0] = "a -row2";
            dr[1] = "b -row2";
            dr[2] = "c -row2";

            dt.Rows.Add(dr);

            var subjects = dt.AsEnumerable().GroupBy(row => new { a = row.Field<string>("a"),c=  row.Field<string>("c")}).Select(i => new { Subject = i.Key, Count = i.Count()}) ;
            foreach (var subject in subjects)
            {
                Response.Write(subject.Subject);
            }


results

{ a = a - row1, c = c -row1 }{ a = a -row2, c = c -row2 }
{ a = a - row1, b = , c = c -row1 }{ a = a -row2, b = b -row2, c = c -row2 }

Basic date Regular Expressions



  1. "dd/mm/yyyy","(3[01]|[12][0-9]|0[1-9])/(0[1-9]|1[012])/[1-2][0-9][0-9][0-9]"
  2. "dd-mmm-yy","(3[01]|[12][0-9]|0[1-9])[-/][a-zA-Z][a-zA-Z][a-zA-Z][-/][1-2][0-9][0-9][0-9]"
  3. "MM/dd/yyyy","(0[1-9]|1[012])/(3[01]|[12][0-9]|0[1-9])/[1-2][0-9][0-9][0-9]"
  4. "yyyy-mm-dd","[1-2][0-9][0-9][0-9][-/](0[1-9]|1[012])[-/](3[01]|[12][0-9]|0[1-9])"  
  5. "yyyy/mm/dd","[1-2][0-9][0-9][0-9]/(0[1-9]|1[012])/(3[01]|[12][0-9]|0[1-9])" 
I cheated on MMM , I know
 

Anomolies of Spreadsheetgear with dates

1)Spreadsheetgear converts "-" into "/"
                so if you have a spreadsheet with a date thus


2011-01-03


                  Spreadsheetgear will convert it to
                                 
                                      2011/01/03

2) Spreadsheetgear describes DD/MM/YYYY,MM/DD/YYYY and YYYY/MM/DD with "\/", but not
YYYY-MM-DD

therefore

 
excel format:DD/MM/YYYY sh/g format:dd\/mm\/yyyy - 01/01/2011
excel format:MM/DD/YYYY sh/g format:mm\/dd\/yyyy - 02/01/2011
excel format:YYYY-MM-DD sh/g format:yyyy/mm/dd - 2011/01/03
excel format:DD-MMM-YYYY sh/g format:dd/mmm/yyyy - 04/Jan/2011
excel format:YYYY/MM/DD sh/g format:yyyy\/mm\/dd - 2011/01/05

3) a date coming from a CSV with a value of 04-Jan-2011 will be converted to d-mmm-yy, 4-Jan-11

4) an excel file that has dates formatted as "Date" will be read by excel with the default culture. Therefore, if you open the file with your own custom culture - this will be the format of the "Date" cells.




Looping through controls with Jquery

I had a situation where components were being created by a custom control inheriting a repeater - the repeater had a dropdown and was being propogated multiple times but always ended with "blah" in the name - the issue was setting all the dropdowns under certain conditions. this is how I did it:


 onClick ='$("[id$=blah]").each( function() { if (this.options[1].value== "whatever"  && this.selectedIndex ==0 ){ this.options[1].selected = true }   ;}      );'