Monday 30 July 2012

Polynomial equations in excel

Polynomial equations in excel: Download Polynomial Formula Excel

You all must be thinking what a topic for a software professional.
After a long time I had put a depth efforts to build one excel formula to get polynomial equation value.


I have taken following reference Material:
3rd Order Polynomial Trendline
     Equation: y = (c3 * x^3) + (c2 * x^2) + (c1 * x^1) + b
     c3: =INDEX(LINEST(y,x^{1,2,3}),1)
     c2: =INDEX(LINEST(y,x^{1,2,3}),1,2)
     C1: =INDEX(LINEST(y,x^{1,2,3}),1,3)
     b: =INDEX(LINEST(y,x^{1,2,3}),1,4)

     http://office.microsoft.com/en-us/excel-help/linest-HP005209155.aspx

Based on the above I have created a 6th order Polynomial trend-line.
Assuming:
1) B2:B9 is x axis
2) C2:C9 is y axis
3) A2 is x

=(INDEX(LINEST(C2:C9,B2:B9^{1,2,3,4,5,6}),1)*A2^6)+(INDEX(LINEST(C2:C9,B2:B9^{1,2,3,4,5,6}),1,2)*A2^5)+(INDEX(LINEST(C2:C9,B2:B9^{1,2,3,4,5,6}),1,3)*A2^4)+(INDEX(LINEST(C2:C9,B2:B9^{1,2,3,4,5,6}),1,4)*A2^3)+(INDEX(LINEST(C2:C9,B2:B9^{1,2,3,4,5,6}),1,5)*A2^2)+(INDEX(LINEST(C2:C9,B2:B9^{1,2,3,4,5,6}),1,6)*A2^1)+INDEX(LINEST(C2:C9,B2:B9^{1,2,3,4,5,6}),1,7)

Share your feedback for sure.

Regards,
Sagar

Monday 21 May 2012

WPF Architecture


Hi Friends,
Today I would  like to discuss some  core part of WPF architecutre. in  WPF ,Presentation Framework, Core Presentation and Media Integration Layer (milcore) Are The Three Major components of WPF architecture. These Are the Major portions of the WPF code. Milcore is cash en Unmanaged Code in order to enable tight integration with DirectX. DirectX engine is responsible for all display in WPF, allowing for efficient hardware and software rendering. CLR Provides fine control over the memory and execution. The composition engine in milcore is Extremely sensitive performance, and required giving up Many advantages of the CLR to gain performance.
Details


To know more about the WPF, one must have a clear idea about the architecture of WPF. The architecture of WPF is Actually multilayered architecture. It spans across Three layers - Managed Code and Unmanaged Code Core operating system, we can call thesis set of layers have built up assemblies That The Entire framework. The major components of WPF are illustrated in Figure below

Managed Layer: - The public API is only Exposed via this layer. Majority of WPF is in managed code.
1)   PresentationFramework.dll: - It Holds the top level WPF elements, Including Those That Represents Windows, panels, controls, styles etc.. It implements the aussi end-user presentation features Including time-dependent, story-based animations and data binding.
2)   PresentationCore.dll: - Presentation Core Provides a managed wrapper for MIL and implements the core services for WPF UI Element Such as visual and from Which all shapes and controls derived inPresentationFramework.dll.
3)   WindowsBase.dll: - Holds more basic Elements Which are able To Be Reused outside environment like the WPF Dispatcher Dependency objects and objects.
Unmanaged Layer
1)   milCore.dll: - While the Majority of WPF is managed in layer, the composition engine Which renders the WPF implementation is a native component. It Is Called as Media Integration Layer (MIL) and Resides InmilCore.dll. The purpose of the milcore Directly interface is to provide statement with DirectX and basic medium for 2D and 3D surface. It is the hand of WPF rendering engine and interface is Between DirectX and CLR.
2)   WindowsCodecs.dll: - WindowsCodecs is Another low level API Which is Used For imaging medium in WPF applications like image processing, image displaying and scaling etc.. It comprised of a number of codecs Which encode / decoded image vector graphics Into That Would Be Into WPF rendered screen.
Core Operating System Layer (kernel):
1)   DirectX - DirectX is the low level API-through Which WPF renders all graphics.
2)   User32: - It the primary core Every Which API implementation uses.Actually user32 memory marriages and separation process.

All WPF applications start with Two threads - one for managing the UI and Another background thread for handling the rendering and repainting.Rendering and repainting is managed by WPF and so it does not require Any developer intervention.

Wednesday 23 November 2011

Progress Dialog


import android.app.Activity;

import android.app.ProgressDialog;

import android.content.pm.ActivityInfo;

import android.os.Bundle;


public class ProgressDialogActivity extends Activity {

/** Called when the activity is first created. */

ProgressDialog pro;

@Override

public void onCreate(Bundle savedInstanceState)

{

super.onCreate(savedInstanceState);

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_USER);

setContentView(R.layout.main);

pro=new ProgressDialog(this);

pro.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);

pro.setMax(300);

pro.setCancelable(true);

pro.setMessage("Loading data..");

pro.show();

Threadex t=new Threadex();

t.start(); //start thread

}//This is Oncreate method

class Threadex extends Thread

{


public void run()

{

for(int i=10;i<=pro.getMax();i=i+10)

{

pro.incrementProgressBy(10);

try

{

sleep(1000); //sleep for 1 seconds

}

catch(Exception e)

{

e.printStackTrace();

}

} //this is for loop ends

pro.dismiss();

} //this is end of Run

}//This is End of Threadex

} //This is End of Activity


Here Update the 10 distance continues Upto 300 distance because we have set 300 distance as max .




This is after the Dismiss the ProgressDialog





This is for ProgressDialog.STYLE_HORIZONTAL.

we can set Another Style ProgressDialog.STYLE_SPINNER but view is different

Monday 14 November 2011

Getting SMS in your Activity

import android.app.Activity;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.widget.TextView;

public class SMSActivity extends Activity
{
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView textview = new TextView(this);
Uri url = Uri.parse("content://sms/inbox");
Cursor cursor = getContentResolver().query(url, null, null, null,null);
String smsdisplay = "";
while (cursor.moveToNext()) {
smsdisplay += "From :" + cursor.getString(2) + " : " + cursor.getString(11)+"\n";
}
textview.setText(smsdisplay);
setContentView(textview);
}
}

in the AndroidManifest.xml

android.permission.READ_SMS

Gives this Permission for Reading SMS in your activity.




Tuesday 12 July 2011

ViewBag v/s ViewData


Hi Friends,
If you go through ASP.NET MVC 3.0 framework then you will find  two frequently  used collection of data object which  used to pass data between control and views  and partial views. as both are doing similar functionality but has  some difference in that , so today , I would like to  put some difference of those and interoperability of that .



ViewData
ViewBag
It is dictionary of name/value pair  collection
It is dynamic  type object
This features exist since 1st release of ASP.NET MVC
This features available from ASP.NET MVC 3.0
This will work  in ASP.NET with .net 3.5 framework and above
This will work well with ASP.NET 4.0  with .net 4.0 framework and above
ViewData is faster compare to ViewBag   
ViewBag is slower than ViewData
While retrieving  data from viewData in to view pages , one need to do proper type casting
While retrieving  data from viewbag in to view pages , one need  not to do  type casting
Hence it make code with lots of  type casting  fragments
Hence it make more clear code

Friday 8 July 2011

Checklist for Validation messages



The following are the Validation/Messages to be checked commonly while executing Add/Edit and Search Page in any applications
ADD
1. Check for Page Title. It should be “Add a/an in
2. Check for Page Heading. It should be “Add
3. Check for the presence of Header & Footer contents.
4. Check for the Labels i.e Field name are meaning full and not having any spelling mistakes.
5. Check for the Mandatory Fields are differentiated by Red color or by red * symbol.
6. Check whether the cursor points to the first field.
7. Check whether the Tab Order is correct.
8. Check whether the required field validations are done in user side JavaScript and also in server side.
a. Check whether Starting and Ending spaces are getting trimmed.

The Changing Paradigm of Testing Industry

Software testing was an important turning point in the IT industry. It has changed the face of the software world today. In today's world, consumer expectations are very high on quality. They want customized access from anywhere, anytime, through any device and within no time and with no glitches. Satisfying such consumer needs and expectations of high quality were only possible by immense software testing. Testing has optimized software business products and has lessened the complexities faced by software developers. It has helped improve the overall software development life cycle.

Opening the event with a keynote session, Arun Kumar Singh, Vice President and Global Head Testing ,Financial Services, Wipro, threw some light on the importance of testing in today's business and tried to forecast where testing will go in years ahead. He spoke about 1.0, 2.0 and 3.0 phases of software testing.