Monday, September 9, 2013

Matlab

write a script that contain following commands:
a matrix A
Q1 Compute average value of element of larger than 2 and smaller than 6
 q2 and replace the element less than 3 by zero


Solution

d=magic(3)
c=0; sum=0;
for i= 1:1:3
for j= 1:1:3
h=d(i,j);
if(h>2 && h<6 )
sum=sum+h;
c=c+1;
end
if(h<3)
d(i,j)=0;
end
end
end
sum
avg=sum/c;
avg
d

Wednesday, September 4, 2013

Matlab


>> h = [false, true, false; true, false, true; false, true, false;]

h =

     0     1     0
     1     0     1
     0     1     0

>> h = logical( [false, true, false; true, false, true; false, true, false;])

h =

     0     1     0
     1     0     1
     0     1     0

>> class(h)

ans =

logical

>> h = [false, true, false; true, false, true; false, true, false;]

h =

     0     1     0
     1     0     1
     0     1     0

>> class(h)

ans =

logical

>> class(a)

ans =

double

>> class(b)

ans =

double

>> j = logical(a)

j =

     1     1     1
     1     1     1
     1     1     1

>> a

a =

     8     1     6
     3     5     7
     4     9     2

>> a= randn(2,2)

a =

    1.4090    0.6715
    1.4172   -1.2075

>> a= randn(4,4)

a =

    0.7172    0.7269    0.8884   -2.9443
    1.6302   -0.3034   -1.1471    1.4384
    0.4889    0.2939   -1.0689    0.3252
    1.0347   -0.7873   -0.8095   -0.7549

>> a= rand(4,4)

a =

    0.9502    0.7655    0.4456    0.2760
    0.0344    0.7952    0.6463    0.6797
    0.4387    0.1869    0.7094    0.6551
    0.3816    0.4898    0.7547    0.1626

>> a= randn(4,4)

a =

   -1.1135    0.3714    0.0326    0.0859
   -0.0068   -0.2256    0.5525   -1.4916
    1.5326    1.1174    1.1006   -0.7423
   -0.7697   -1.0891    1.5442   -1.0616

>> j = logical(a)

j =

     1     1     1     1
     1     1     1     1
     1     1     1     1
     1     1     1     1

Wednesday, May 1, 2013

sql command


public static void GetStudentById(int studentID)
        {
            using (OleDbConnection connection = new OleDbConnection
                 (@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Students.mdb;Persist Security Info=True"))
            {
                connection.Open();
                using (OleDbCommand command = connection.CreateCommand())
                {
                    command.CommandType = CommandType.StoredProcedure;
                    command.CommandText = "GetStudentById";

                    command.Parameters.AddWithValue("@studentID", studentID);

                    OleDbDataAdapter adapter = new OleDbDataAdapter(command);
                    adapter.TableMappings.Add("Table", "Students");

                    StudentsDataSet dataset = new StudentsDataSet();

                    adapter.Fill(dataset);

                    DataSetDump.ShowDSInOutputWindow(dataset);

                }
            }

How to create a DataView from DataTable?


In order to create a DataView from a DataTable, use instantiate the DataView object by passing DataTable as parameter in the constructor.

eg.

DataView dView = new DataView(dTable);

Can DataAdapter object accept DataTable as parameter in Fill method?


Yes,

DataAdapter object can accept either DataTable or DataSet as parameter to fill data from database.

eg.

SqlDataAdapter dAd = new SqlDataAdapter();

DataTable dTable = new DataTable();

DataSet dSet = new DataSet();

----

---

dAd.Fill(dTable); // will also work

dAd.Fill(dSet); // will also work

Wednesday, March 6, 2013

CPI

Course CodeFaculty NameUpload DateSubmission TillTopic




File Upload By Teacher
CSE053Igloo Jain03/01/2013 Submission Not Required BIOS      Downlaod
CSE053Igloo Jain03/01/2013 Submission Not Required AMD      Downlaod
CSE053Igloo Jain03/01/2013 Submission Not Required Power Supply      Downlaod
CSE053Igloo Jain03/01/2013 Submission Not Required MS Dos Driver example      Downlaod
CSE053Igloo Jain03/01/2013 Submission Not Required I Processors      Downlaod
CSE053Igloo Jain03/01/2013 Submission Not Required Device Drivers      Downlaod
CSE053Igloo Jain02/28/2013 Submission Not Required Video Display Technologies      Downlaod
CSE053Igloo Jain02/28/2013 Submission Not Required Motherboard Components      Downlaod
CSE053Igloo Jain02/28/2013 Submission Not Required Monitor Selection Criterion      Downlaod
CSE053Igloo Jain02/28/2013 Submission Not Required I series      Downlaod
CSE053Igloo Jain02/28/2013 Submission Not Required AMD vS Intel      Downlaod
CSE053Igloo Jain02/13/2013 Submission Not Required Intel i series processors      Downlaod
CSE053Igloo Jain02/07/2013 Submission Not Required Intel Microprocessors      Downlaod
CSE053Igloo Jain02/02/2013 Submission Not Required Hardware organization of Computer system      Downlaod
CSE053Igloo Jain02/01/2013 Submission Not Required Local Buses      Downlaod
CSE053Igloo Jain02/01/2013 Submission Not Required IO Buses      Downlaod
CSE053Igloo Jain01/23/2013 Submission Not Required IO Ports      Downlaod
CSE053Igloo Jain01/14/2013 Submission Not Required System Resources      Downlaod

Saturday, March 2, 2013

pick up adversitement from here lifestreetmedia

<!-- Begin Ad Call Tag - Do not Modify -->
<iframe width='720' height='300' frameborder='no' framespacing='0' scrolling='no' src='//ads.lfstmedia.com/slot/slot48655?ad_size=720x300&adkey=226'></iframe>
<!-- End of Ad Call Tag -->

<!-- Begin Ad Call Tag - Do not Modify -->
<iframe width='300' height='250' frameborder='no' framespacing='0' scrolling='no' src='//ads.lfstmedia.com/slot/slot48440?ad_size=300x250&adkey=7da'></iframe>
<!-- End of Ad Call Tag -->