Wednesday, February 27, 2013

INFORMATION_SCHEMA lacking view for Default contraints

bizarre omission

use either INFORMATION_SCHEMA.COLUMNS   to get the default on the column
or sysobjects WHERE xtype = 'D'  for info about the constraint

Print Screen copies black area

I am guessing this has to do with graphics accelerators and what-not.
alt-printscreen still works

Tuesday, February 26, 2013

Unable to start Program there are no more files

very ominous sounding .




I found a bunch of IE's running in the background that I had to kill.



Friday, February 22, 2013

Flags On Enum

2 points


  1. make sure the numbering of the enum is base 2 
  2. don't check for the first value (0),if you must - use that for a nothing value

Concatenate list with LINQ

listBlah.Aggregate((first, second) => first + "<BR />" + second)

TFS Error: The cache file VersionControl.config is not valid and cannot be loaded

Just delete VersionControl.config

Thursday, February 21, 2013

Testing CSS Properties When Inherited

testing with javascript is not helpful because it returns "inherit"
JQuery css function likewise returns "inherit"

I used the is function - that works properly

for e.g. $(this).is(":visible")

Friday, February 15, 2013

Checkboxlist in Chrome not rendering well

when the Checkboxlist  was in a div - the text was wrapping.

so I did this

   //////////////////////////////////////
            $('document').ready(function () {
                $(":input[id^=chkListblah_]").each(
                          function () {
                              $(this).get(0).parentElement.style.whiteSpace = "nowrap";
                            }
                    );
            });
          
            //////////////////////////////////////

Count of checkboxes in a checkboxlist object

since thisis rendered by asp.net as a table I thought a count of the cells would work.
it worked in IE but not Chrome

so I did this

$(":input[id^=chkListblah_]").length;

where the checkboxes id's were chkListblah_1, chkListblah_2 etc.

Wednesday, February 13, 2013

Ordering objects with LINQ by multiple properties

I did it thusly



blah.OrderBy(x => x.firstprop).ThenBy(x => x.secondprop).Select(x=>string.Format("{0}:{1}", x.firstprop,x.secondprop)).ToList() ;  

Tuesday, February 12, 2013

check for null and zero length in SSIS

I did it thus

ISNULL([Column 0]) ?  FALSE  : LEN([Column 0]) > 0

I did it this way not to avoid short circuit issues
also, of course len on a null is null

Thursday, February 7, 2013

Bizarre HTML formatting by IE


<TABLE border=0 cellSpacing=0 cellPadding=0 width="100%">
<TBODY>
<TR>
<TD></TD>
<TD >
<SPAN>Hody&nbsp;Doe:&nbsp;!away_we_go</SPAN>
</TD>
<TD width="100%"></TD>
</TR>
</TBODY></TABLE>



since the 3rd td is 100% it forces the 2nd td into 2 lines because it thinks this is a new sentence


Hide Scrollbar in Div with Overflow

overflow-y: hidden;

or

overflow-x: hidden;

Wednesday, February 6, 2013

Bizarre c# features : global


namespace hody
{
    public partial class Form1 : Form
    {


private void button6_Click(object sender, EventArgs e)
        {
            feh.showfeh();
            global::feh.showfeh(); 
        }

public static class feh
    {
        public static  void showfeh()
        {
            MessageBox.Show("feh");
        }
    }




//a different file

using System.Windows.Forms;


   public static class feh
    {
        public static void showfeh()
        {
            MessageBox.Show("global feh");
        }
    }


Checking parameter length in sp's



select pr.name, p.*, t.name, t.max_length
from sys.procedures pr
inner join sys.parameters p on pr.object_id = p.object_id
inner join sys.types t on p.system_type_id = t.system_type_id
where  p.max_length =24

Tuesday, February 5, 2013

what are the benefits of a service over a plain exe?

I guess the main point is that services are centralized.
otherwise, things like setting for start up can be done with exe's also.

is the event log a good place to log your application?

just wondering

Monday, February 4, 2013

How to update a project file's xml in VS

first -> unload project ->check out -> make changes-> check in->upload project

How to get list of Changesets

rick click on aspx file -> get specific version

why isn't there an easier way?

Designer page woes

I was copying .cs and aspx from one branch to another. The compile failed - the designer didn't regenerate.
This was even though I opened in designer and there were new components.