Wednesday, September 17, 2014

pragmatic - Word of the day

prag·mat·ic
pragˈmatik/
adjective
  1. dealing with things sensibly and realistically in a way that is based on practical rather than theoretical considerations.

SSL Chrome

SSL certificate technology is always improving to stay ahead of hackers. We regularly update to the most current and effective standards. We recently switched from using SHA-1 certificates to the more secure SHA-2 algorithm for new certificates.
Google Chrome is a very popular internet browser. Starting in November, they'll begin displaying errors on the padlock icon for any website using SHA-1 SSL certificates. Learn more here.


The following SSL certificate(s) are still using the SHA-1 algorithm. Re-key them to update to SHA-2 and avoid problems in November.

Wednesday, May 28, 2014

Determine .NET Version - Shared by Walt Daniels

Run this from a Command prompt (not a powershell prompt) … it takes a minute, be patient.


wmic /namespace:\\root\cimv2 path win32_product where "name like 'microsoft%.NET%'" get name, version

Friday, May 09, 2014

jQuery Lightbulb

If you want to learn jQuery, which is a hot tech skill these days head over to www.codecademy.com

The following statement had the light bulb go off:

VERY IMPORTANT ---

You know a lot about jQuery events already, but it never hurts to review the basics.
The setup almost always looks like this:
$(document).ready(function() {
    $('thingToTouch').event(function() {
        $('thingToAffect').effect();
    });
});
where "thing to touch" is the HTML element you'll click on, hover over, or otherwise interact with, and "thing to affect" is the HTML element that fades away, changes size, or undergoes some other transformation.
Sometimes these elements are one and the same—you might hover over a <div> to change its opacity. Other times, you might interact with a separate element; for example, you might click on a button to resize a <div>.
Sometimes if you want an effect to occur right away, without an event like .click() or.hover(), you'll skip the second line in the above:
$(document).ready(function() {
    $('thingToAffect').effect();
});

Wednesday, March 26, 2014

Reset Visual Studio Windows if Windows Start opening in different panes

Windows:  ALT + W, R 
Menu:   Window | Reset Window Layout 
Command:  Window.ResetWindowLayout 
Versions:  2005, 2008, 2010, 2012, 2013 

Monday, March 10, 2014

LINQ Queries OR SQL checking Nothing or Null Values

You need to check if it's Nothing first and use the AndAlso keyword to stop it from evaluating the latter statement. Also, when checking if the and object is null, you should use the Is or IsNotoperator rather than =. This should work

Dim otherRecords As List(Of Objects) = listOf.Where(Function(x) _
                                                        (x.ID_NUM = newID) AndAlso _
                                                        (x.Codes IsNot Nothing) AndAlso _
                                                        (x.Codes.Contains(ddlPrimaryCode.SelectedItem.Text.Trim()))).ToList()

Tuesday, March 04, 2014

Stored Proc Place holder to be filled later example

SELECT

Field1,
Field2,
Field3,
' ' AS FieldName,
FROM tbl_name
WHERE field = @param


Later fill this with the data you need.

Wednesday, February 05, 2014

TFS MSBuild Workflow Toolbox

Do you still have the Team Foundation Build Activities tab?  If not, you probably deleted it.  To get it back, you can right-click on the toolbox and select "Reset Toolbox". This will get it back to the default, which should contain the lost tab.
You could also add them by right-clicking on the toolbox, then "Choose Items", then "Browse" and select C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.Build.Workflow.dll.

Monday, January 06, 2014

LAWS OF PROJECT MANAGEMENT

1. No major project is ever installed on time, within budget, or
with the same staff that started it. Yours will not be the
first.

2. Projects progress quickly until they become 90% complete,
then they remain at 90% complete forever.

3. One advantage offuzzy project objectives is that they let
you avoid the embarrassment of estimating the
corresponding costs.

4. When things are going well, something will go wrong.
• When things just cannot get any worse, they will.
• When things appear to be going better, you have
overlooked something.

5. If project content is allowed to change freely, the rate of
change will exceed the rate of progress.

6. No system is ever completely debugged. Attempts to debug
a system inevitably introduce new bugs that are even harder
to find.

7. A carelessly planned project will take three times longer to
complete than expected; a carefully planned project will
take only twice as long.

8. Project teams detest progress reporting because it vividly
manifests their lack of progress.

Monday, December 30, 2013

Family, Friends and fellow Developers

Merry Christmas and Happy New Year.  Hope everyone is prosperous and joyful in the coming 2014 year. In 2013 we have have lost and gained Family and Friends.  God Bless everyone. 

Love is patient, love is kind. It does not envy, it does not boast, it is not proud. It does not dishonor others, it is not self-seeking, it is not easily angered (RBD comment - but can be), it keeps no record of wrongs. Love does not delight in evil but rejoices with the truth. It always protects, always trusts, always hopes, always perseveres.

Love never fails. But where there are prophecies, they will cease; where there are tongues, they will be stilled; where there is knowledge, it will pass away. 









Friday, December 20, 2013

ie8 textarea or textbox multiline cursor jumping

IE8 has a known bug (per connect.microsoft.com) where typing or pasting text into a TEXTAREA element will cause the textarea to scroll by itself. This is hugely annoying and shows up in many community sites, including Wikipedia. The repro is this:
  1. open the HTML below with IE8 (or use any long page on wikipedia which will exhibit the same problem until they fix it)
  2. size the browser full-screen
  3. paste a few pages of text into the TEXTAREA
  4. move the scrollbar to the middle position
  5. now type one character into the textarea
Expected: nothing happens Actual: scrolling happens on its own, and the insertion point ends up near the bottom of the textarea!
Below is repro HTML (can also see this live on the web here: http://en.wikipedia.org/w/index.php?title=Text_box&action=edit)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" ><body>
 <div style="width: 80%">
   <textarea rows="20" cols="80" style="width:100%;" ></textarea>
 </div>
</body></html>
I know I can avoid this by forcing the website into IE7 compatibility mode, but what's the best other way to work around this bug while causing as few side-effects as possible?

THE ANSWER ----

I ended up wasting a lot of time trying to figure out the answer myself, so I figured I'd save others the trouble of answering. The trick is to use a very large value for the COLS attribute on the TEXTAREA element. Like this
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<body> 
<div style="width: 80%"> 
<textarea rows="20" cols="5000" style="width:100%;" ></textarea> 
</div> 
</body> 
</html> 
I also saw a workaround online to use a non-percentage width and then a percentage max-width and min-width, but that was much less impactful than the other workaround above (courtesy of Ross) which seems to work on all browsers including IE6.
more details: After an hour investigating this, the problem seems to be caused by IE8's handling of a conflict between "COLS" attribute and "width" style on a textarea element. If the width CSS is wider than the default width (font width x cols), IE8 gets confused when you add text and scrolls the textarea. If, instead, the width CSS is smaller than the default width derived from the cols attribute, then all works OK.
The subtle dependence between cols and width is perhaps what makes the problem so tricky to repro, because the same exact page would break or not break depending on the ratio of cols to width. The HTML in the quesiton actually reproes the bug on a large browser window and doesn't repro on a small one!

Friday, December 13, 2013

HTML 4.01 Features Removed

Removed Elements

The following HTML 4.01 elements are removed from HTML5:
  • <acronym>
  • <applet>
  • <basefont>
  • <big>
  • <center>
  • <dir>
  • <font>
  • <frame>
  • <frameset>
  • <noframes>
  • <strike>
  • <tt>

New Cool site for Browser Compatibility

http://caniuse.com/

Hour of Code

http://code.org/  --- It is a history maker.

HTML5 --- Been using HTML since HTML and HTML 4.01 and decided to take training on www.w3schools.com

Looks like it will be a good course.


The HTML5 <!DOCTYPE>

In HTML5 there is only one <!doctype> declaration, and it is very simple:
<!DOCTYPE html>


Minimum HTML5 Document

Below is a simple HTML5 document, with the minimum of required tags:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title of the document</title>
</head>

<body>
Content of the document......
</body>

</html>

Monday, December 09, 2013

Populate Drop Down List for ASP.NET Web Control

try
            {
                using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["connString"].ConnectionString))
                {
                    conn.Open();
                    using (SqlCommand cmd = new SqlCommand("Select *  FROM [tbl_data] ORDER BY main", conn))
                    {
                        cmd.CommandType = CommandType.Text;
                        using (SqlDataReader reader = cmd.ExecuteReader())
                        {
                            if (reader.HasRows)
                            {
                                while (reader.Read())
                                {
                                   NameAndCounty = reader["NameAndCounty"].ToString();
                                   Id = reader["Id"].ToString();
                                    ddlNameAndCounty.Items.Add(new ListItem(NameAndCounty, Id));                
                                }
                            }                          
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                return ex.Message.Trim();
            }

Thursday, December 05, 2013

SQL Server RAISERROR

RAISERROR('SQL Does not like the data',16,1)  Break down of the RAISERROR

For the most part, the same exception ranges apply: exception levels between 1 and 10 result in a warning, levels between 11 and 18 are considered normal user errors, and those above 18 are considered serious and can only be raised by members of the sysadmin fixed server role. User exceptions raised over level 20, just like those raised by SQL Server, cause the connection to break.

The state argument can be any value between 1 and 127, and has no effect on the behavior of the exception. It can be used to add additional coded information to be carried by the exception—but it’s probably just as easy to add that data to the error message itself in most cases. I generally use a value of 1 for state when raising custom exceptions.

Reference - http://dataeducation.com/blog/sql-servers-raiserror-function

Monday, December 02, 2013

Label -vs- Literal - Stack Trace

The main difference is that Literal controls just render out text, but Label controls surround it with<span> tags (Unless you use the AssociatedControlID property, in which case a Label control will render a <label> tag).
So, labels can be styled easier, but if you're just inserting text, literals are the way to go. Literal controls also have a handy property Mode which governs how the text is rendered. You can have it HTML-encoded, or rendered without any changes, or have any "unsupported markup-language elements" removed.
If you're not applying any styles (e.g. by using Label's CssClass property), it will be fine to replace Labelcontrols with Literal controls.

T-SQL WHERE statement for NULL Values

SELECT * FROM table WHERE Field IS NULL

Friday, November 08, 2013

Using HibernatingRhinosProfiler with Console Application


1) Add Reference to - C:\Program Files (x86)\EntityFramework.Profiler\HibernatingRhinos.Profiler.Appender.dll

2) Add to Main(string[] args

public static void Main(string[] args)
        {
            HibernatingRhinos.Profiler.Appender.EntityFramework.EntityFrameworkProfiler.Initialize();