Thursday, April 21, 2016

Unit Testing a loading of correct View in MVC




[TestMethod]
public void AboutReturnsAboutView()
{
     HomeController controller = new HomeController();
     ViewResult result = controller.About() as ViewResult;

     Assert.AreEqual("About", result.ViewName);
}
Note that this will fail if you don't return an explicit view in your controller method, i.e. do this:


     Return(View("About"));
not this:


     Return(View());
Or the test won't pass. You should only need to do this if your method will ever return more than one view, otherwise you should return an implicit view anyway and not bother testing the framework.


Refer: Professional ASP.NET MVC 1.0 (book):

Metro tiles

.metro-tile {
background-color: #D8512B;
border-color: #DC6241;
width: 232px;
height: 104px;
padding: 5px;
color: #FFF;
font-family: sans-serif;
font-size: 12px;
border-width: 3px;
border-style: solid;
cursor: default;
-webkit-transition: 0.1s all;
-moz-transition: 0.1s all;
-ms-transition: 0.1s all;
transition: 0.5s all;
}

.metro-tile-small {
width: 104px;
height: 104px;background-color: #2878EC;
border-color: #2878EC;
}

div.metro-tile:hover {

transform: scale(1.3) perspective(400px) rotateY(0deg) rotateX(0deg);
border-width: 3px;
border-style:solid;
}

http://cssdeck.com/labs/windows-8-metro-tiles-with-css3

//#2878EC; blue

//#6CB71E; green

//#009719; dark green

//#3B5998; fb blue

Wednesday, April 20, 2016

Tip # 1: Avoid race condition in app variables

Application.Lock();
Application["tod"] = HttpUtility.HtmlEncode(tod.Text);
Application.UnLock();

using (System.IO.StreamWriter file = new System.IO.StreamWriter(Server.MapPath("~/App_Data/tod.txt"), false))
{
     file.WriteLine(tod.Text);
}


Tip # 2: Writing file data in single line of code in simplest way

System.IO.File.WriteAllText(Server.MapPath("~/App_Data/tod.txt"), tod.Text);


Tip # 3: For pages that are not to be cached always use this meta tag

<meta http-equiv="cache-control" content="no-cache" />
-Works with Chrome

<meta http-equiv="Pragma" content="no-cache" />
-Does NOT work with chrome but works with FF and IE


Tip # 4: Reading file data using single line of code in simplest way

 HttpUtility.HtmlEncode( System.IO.File.ReadAllText(Server.MapPath("~/App_Data/tod.txt")


instead of

//string text = System.IO.File.ReadAllText(@"C:\Users\Public\TestFolder\WriteText.txt");
        // System.IO.File.WriteAllText(@"C:\Users\Public\TestFolder\WriteText.txt", text);
    }

Monday, April 18, 2016

5 proven ways to motivate and retain your technology team

Are you looking to build an environment for your technology professionals that fosters loyalty and growth?

5 proven ways to motivate and retain your technology team, and learn about the key areas that you need to pay a certain amount of attention if you plan on retaining your tech staff:

The work environment
Education
Hardware/software programs
Perks of hard work
Recognition



http://pluralsight-assets.s3.amazonaws.com/pdf-assets/Pluralsight_Guide_Motivate_rebranded.pdf

Warning:Unable to find optional library: org.apache.http.legacy

In lollipop development the library containing http protocols wont work, for that you have add this line to the gradle.

useLibrary 'org.apache.http.legacy'

and then sync it



Warning:Unable to find optional library: org.apache.http.legacy


guess, the easier way to solve this issue without having to reinstall the SDK is to create a file called optional.json in <sdk-path>\platforms\android-23\optional\ directory with the following content:

[
  {
    "name": "org.apache.http.legacy",
    "jar": "org.apache.http.legacy.jar",
    "manifest": false
  }
]
It solved the problem for me.

EDIT: Information taken from @domoch's answer below on how to locate your SDK location

To Locate your Android SDK's Location
Go to Android Studio Settings -> Appearence & Behavior -> System Settings and look for Android SDK Location. In Windows, it usually would be pointing to C:\Users\<username>\AppData\Local\Android\sdk.

Reduce Java software maintenance costs by 30-40% by efficient engineering of technical debt


Attended. Speaker was very good.


2:50 PM 7/31/2015
Reduce Java software maintenance costs by 30-40% by efficient engineering of technical debt

Speaker 1: Raja Nagendra Kumar, CTO, TejaSoft
Speaker 2: Choudary Kothapalli, Architect, MaintainJ Inc

Why technical debt is unavoidable during development and maintenance of large enterprise applications
Different forms of technical debt
How the technical debt results in significantly higher costs in all phases of the maintenance life cycle
Current techniques and tools used to manage the technical debt (after the technical debt occurs)
Static analysis techniques and tools Vs. Runtime analysis techniques and tools
Discuss the tools and techniques to reduce the costs in all phases of maintenance life cycle