Monday, April 18, 2016

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

Friday, March 11, 2016

How to capture value of a radio button in Java script?



Today I am answering a few questions newbies ask time and again.

Topic - JavaScript

How to show value of an variable?

var num = 5;
alert(num);


How to display value of an element?

alert(document.getElementById("txtName").value);


How to capture / read value of radio button?

alert(document.getElementById("isNew").checked);




I have written one example for demonstration of radio button use.
Please save this as an demo.html file and open in browser

<!DOCTYPE html>
<html>
<body>

<p>Please select gender:</p>

<form>
  <input type="radio" name="gender" value="Male"> I am boy<br>
  <input type="radio" name="gender" value="Female">I am girl<br>
  <br>
  <input type="button" onclick="go()" value="GO">
  <br><br>
  <input type="text" id="txtDisplay" size="50" value="Make selection">
</form>

<script>
function go() {
    var gender = document.forms[0];
    var txt = "";
     for (var i = 0; i < gender.length; i++ ){
        if (gender[i].checked) {
            txt =gender[i].value ;
        }
    }

    document.getElementById("txtDisplay").value = "You have selected gender as " + txt;
}
</script>

</body>
</html>

Please comment if you read this post.
Like it Share it so that someone else will also benefit.

Saturday, April 05, 2014

Synchronous call to ASP.NET WebAPI

Being on older technology stack I was unable to use the Async based code sample for webAPI
so this is my current work around. I am using VS 2010 .NET framework 4.0

public string testapi()
 {
using (var client = new HttpClient())
{
var response = client.GetAsync("http://localhost:3507/api/course").Result;
var result = response.Content.ReadAsStringAsync().Result;
return result;
}
}

Thursday, March 20, 2014

Product Management & Marketing: Recipe for Successful Product Development Team

Trust Your Team :
Only trust can hold the team together and supply the everlasting energy to execute at take risk at some courses.

Indecision is  Sin :
Decide and move ahead , come what may. Nothing demotivates like an undecided manager.

Say no to Fear:
Fear is bound to surround in product development as the stakes are high. Let go whatever is holding you back. Drop your doubts worries and fear. Even the failures can be turned around if you are fearless.

Finally the most important ingredient I feel is

Clarity Of Vision
Be crystal clear about your vision only. If the vision is clear to team members they can judge their actions themselves and would save you from petty decisions that waste your time.

Effective delegation :
Delegate and empower your team to take action . Delegate - verify - delegate more. Sure way building accountability .


Personal opinions based on my experiences in product development and team building.

- Vishwajit Girdhari

Product Management & Marketing: Recipe for Successful Product Development Team

Friday, February 01, 2013

Adding click event to button through Javascript using addEventListener


Adding button to DOM and futher adding click event to button through Javascript using addEventListener

<!DOCTYPE html>
<html>
<head>
<script>
function btnclick(person)
{
alert(person + " is free tomorrow!");
}


function load()
{
alert("Just one question...");
var s = document.getElementById("page-content");
var i = document.createElement("button");
i.innerHTML="myBtn";
s.appendChild(i);

if(i.addEventListener)

i.addEventListener('click',function (){btnclick("Vinayak");}, true);
}
 
}
</script>
</head>

<body onload="load()">
<div id="page-content"></div>
<p>Who is free from tomorrow?</p>
</body>
</html>

- Vishwajit Girdhari, .NET Enthusiast 

Friday, October 12, 2012

Adding jquery calendar control to DotNetNuke module



jQuery provides with calendar and they call it datepicker
DotNetNuke provides with inbuilt jquery.js and jquery-ui.js so you don't have to bother to link them separately
In regular html / asp.net application you would have to add following lines in <head> tag
     <script src="http://code.jquery.com/jquery-1.8.2.js"></script>     <script src="http://code.jquery.com/ui/1.9.0/jquery-ui.js"></script>     <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.0/themes/base/jquery-ui.css" />

You dont need them in DNN.
If you are developing a custom DNN module add this to your user control view.ascx file.
I have txtStartDate as a text field on the form where I wanted my calander to be rendered on click.
To achieve this I added this code at the top of my ascx page after the standard includes.
<script type="text/javascript" >
$(function () {
    $("#<%= txtStartDate.ClientID %>").datepicker();
});
</script>
The calender takes the size based on your text size if it is appearing bigger that your expectation
set it style like this
<style>
div.ui-datepicker{
font-size:10px;
}
</style> 

Tuesday, September 18, 2012

Getting Current User Info in DotNetNuke

// DNN Get Current User


// The Current user information can fetch using UserController and
// is availble as UserInfo object:
 

 private UserInfo _currentUser =
                   DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo();

// To get UserID of the current user we can then access the fetched UserInfo object:

 int UserID = _currentUser.UserID

Tuesday, September 04, 2012

DotNetNuke Error: System.Web.UI.UserControl' does not contain a definition for 'CreatedByUser'


Another tiring issue because of  automatic code generation of .designer.cs while building
DotNetNuke Module from asp.net User Control.

My asp.net user control was working flawlessly when I converted it in to DNN Module it was
not getting build. It was giving this error.

Error 16 'System.Web.UI.UserControl' does not contain a definition for 'CreatedByUser' and no extension method 'CreatedByUser' accepting a first argument of type 'System.Web.UI.UserControl' could be found (are you missing a using directive or an assembly reference?)


Solution:

I found the reason.. Apparently when a rename occurs the definitions are changed.
Originally the definitions where these:
protected global::DotNetNuke.UI.UserControls.LabelControl lblContent;
protected global::DotNetNuke.UI.UserControls.ModuleAuditControl ctlAudit;


After the renaming, they magically became these:
protected global::System.Web.UI.UserControl lblContent;
 protected global::System.Web.UI.UserControl ctlAudit;

As did every other control in the .designer.cs files!


Ref : http://www.dotnetnuke.com/Resources/Forums/forumid/199/threadid/355899/scope/posts.aspx


DNN Error - Could not create type 'DotNetNuke.Modules.Journal.ProfilePic


'Error 21 Could not create type 'DotNetNuke.Modules.Journal.ProfilePic''  
I was getting this error in when I was trying to compile latest DotNetNuke Community Edition CMS Version 06.02.0
This issue was appearing weird as the file contained no code. There was nothing could be done about it.
But finally it seems to build packaging problem from DNN Team. 

"You may safely delete this file." is what the DNN guys says. huh. thats a big relief ! !

>>Reply from DNN<<

There seems to be a file in the install package that shouldn't have been included. If you see a file named ProfilePic.ashx in the DesktopModules/Journal directory you can safely delete this file. This file was created before we moved to handler that was integrated with the core project.

Will Morgenweck
Director of Product Management
DotNetNuke Corp.

Tuesday, August 21, 2012

Ek Tha Tiger




He lived/s in Kahna ....

Was visited by Tigers Adventure Campers ....
www.tigers9.com


Thursday, August 09, 2012

IIS Server on Windows 7 Home Basic



To Install IIS 7.5 on Windows 7 Home

Click Start and then click Control Panel.

In Control Panel, click 'Programs and features' then click 'Turn Windows features on or off'.

In the Windows Features dialog box, click Internet Information Services and then click OK.

Developers are recommended to select Application Development Features or Web Management Tools in the  check boxes associated with those features.

P.S. Getting ready on DNN Module Development. Keep watching this blog for more updates on same ...  ;)

Friday, September 30, 2011

Form Validation in flex 2.0 programatically

There are couple of approaches for performing form validation in flex.
Here I would be presenting the combination that appeared to me more logical and eligant.



< height="100%" width="100%">
<mx:formitem required="true" label="User ID" >
< id="txtUserId" width="235" height="20" focusout="performRequiredFieldValidation(event);">


do what you like ........

Monday, November 27, 2006

Introduction to Flex Data Services 2

Introduction to Flex Data Services 2
11/28/2006
2:00 PM US/Eastern

http://www.adobe.com/cfusion/event/index.cfm?event=track&id=539086&loc=en_us

Tuesday, November 14, 2006

Calling web services in ActionScript


Calling web services in ActionScript


private function initMe(e:Event):void {

con.useProxy = false ;
con.wsdl = http://localhost/TestService.asmx?wsdl;
if (con.canLoadWSDL()){
con.loadWSDL();
}

con.login.addEventListener("result", loginResultHandler);
con.addEventListener("fault", wsFaultHandler);

}

private function loginClickHandler (event : Event ){

con.login(t1.text , t2.text );
}

private function wsFaultHandler (fault : Object ){

Alert.show(""+fault.faultString);
}

Tuesday, October 31, 2006

Sending custom class object thru remoting using OpenAmf

Passing UDT from java to flex using openAmf based remoting.

Finally the battle is over. Was in lot of pain pasing a
custom object as response to remote call to java. 2 man days
wasted.

Java (server side) :

Remote Class (UDT): TestClass.java

package com.vishwajit.test.BO;

import java.io.Serializable;

public class TestClass implements Serializable {

private String testValue ;

public TestClass() {
}

public String getTestValue() {
return testValue;
}

public void setTestValue(String testValue) {
this.testValue = testValue;
}
}

Remote Method : (Inside Service.java)

public static TestClass Test()
{
TestClass obj = new TestClass();
obj.setTestValue("setyblch");
return obj;
}

Open AMF Mapping

(if you have not already set this one...)
<amf-serializer>

 <force-lower-case-keys>false</force-lower-case-keys>

</amf-serializer>

      


<custom-class-mapping>>

 <java-class>com.vishwajit.test.BO.TestClass</java-class>

 <custom-class>vishwajit.TestClass</custom-class>

</custom-class-mapping>



Client Side (flex / swf):

public function TestHandler (obj : Object ):void {

var testObj:TestClass = TestClass(obj);
Alert.show("" + testObj.testValue );
}

Wednesday, October 25, 2006

Problem invoking any webservice operation if the API contains a method called 'logout'

Figured out a weird issue with Flex 2.0 / Flash Player 9 . Your comments welcome.


Issue:
When you are calling any webservice where the API contains a method/function/operation named 'logout' your call wont be processed.
and you get the exception mentioned in trace .

Just to confirm the issue I tried writing webservice in Intersystems Cache and .NET 1.0 .
The issue lies with webmethod name 'logout' , if its renamed to something else the life is good.

Trace :
TypeError: Error #1034: Type Coercion failed: cannot convert MC{mx.rpc.soap.mxml::WebService@1393c41 mx.rpc::AbstractService/logout()}@132a7b9 to mx.rpc.soap.Operation.

Tuesday, October 17, 2006

Webservice Result for Flex 2

Getting result of Webservice.

Result is available in the operation object property lastResult.

Sample
Alert.show(loginWS.login.lastResult + "");

Crossdomin access for webservice

1 Invoking webservice in Flex without FDS
2 Solution for MessaginError message='Unknown destination'DefaultHTTP'.'

1
If You are not using FDS
On the Webserice Object
set 'proxy' = false
do not set the 'destination' property instead
set 'wsdl' to the path of wsdl

2 Use crossdomin.xml file on the server that is hosting the webservice. This file should grant access to clients domain. Place this file at the root of the webserver.

example

<?xml version="1.0"?>

<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">

<cross-domain-policy>

   <allow-access-from domain="*" />

</cross-domain-policy>





Any other queries : Post comment.

Calling a webservice in Flex 2

Making a webservice call in Action Script 3.0
Without using FDS

Flex webservice Sample.

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" creationComplete="creationCompleteHandler()" >

 <mx:WebService id="loginWS"

 

 wsdl="http://vishwajit/TestWS/Service1.asmx?WSDL"

  

 useProxy="false" 

 fault="wsFault(event)" >

 

 <mx:operation name="HelloWorld" result="HelloWorldResult(event)" 
>   


  </mx:operation>

 

 <mx:operation name="login" result="getLoginResult(event)"  >

    <mx:request xmlns="" >  

    <loginId>a1</loginId>

    <password>a1</password> 

   </mx:request>

  </mx:operation>

 </mx:WebService>

 

 

 <mx:Script>

  <![CDATA[

  import mx.controls.Alert;

  

  public function creationCompleteHandler()

  {

  

  

  loginWS.login.send();  

  //loginWS.HelloWorld.send();

 

  }

   

   

  public function HelloWorldResult(result : Object)

  {

   Alert.show("HelloWorldResult");

  }

   

   



  public function wsFault(fault:Object)

  {

   Alert.show(""+fault);

  }

   

  ]]>

 </mx:Script>

</mx:Application>




Time wasted/invested on the issue 2.5 Man days