Showing posts from October, 2014

Code to print sin, cos, tan and square wave is scilab software using subplot function

a=input(“Enter amplitude”); t=0:0.001:1; y=a*cos(2*%pi*10*t); subplot(4,1,1); plot(t,y);p=a*sin(2*%pi*10*t); subplot(4,1,2); plot(t,p); d=a*squarewave(2*%pi*10*t); subplot(4,1,3) plot(t,d); f=a*tan(2*%pi*10*t); subplot(4,1,4); plot(t,f); Click Here For More Information About Scilab

What happens when executing program tries to change its text section ?

 If a process mistakenly attempts to overwrite its text space, it incurs a protection fault that typically results in termination of the process. For example, the program in shown below assigns the pointer ip to the address of the function f() and then arranges to catch all signals. If the program is compiled so that text and data are in separate regions, the process executing the program incurs a protection fault when it attempts to write the contents of ip , because it is writing write-protected text region. The kernel sends a SIGBUS signal to the process on an AT&T 3820 computer, although other implementations may send other signals. The process catches the signal and exits without executing the print statement in main. However, if the program were compiled so that the program text and data were part of one region (the data region), the kernel would not realize that a process was overwriting the address of the function f. The address off contains the value 1! The process execu

Cross database queries in pgAdmin–III

pgAdmin do not provide direct support for cross database queries, but we can achieve results similar to such queries by using two extensions provided with pgAdmin (9.3.*)    1. Dblink    2. Foreign data wrapper (FDW) I found FDW easy to use as compared to Dblink, so we will be discussing FDW extension here, consider following Example: Suppose that we have table employee with schema employee ( eid, name, location, salary,dob, dept) Say for security reasons salary information for employees needs to be maintained at Company Headquarter Server located in Mumbai. Now to solve the above problem statement we need to write cross database queries on server located at Mumbai and after that once we found main table employee to be accessible on the Mumbai’s server then we can create materialized view, which will be containing only salary attribute of main employee table.Following are the queries and steps to solve above problem 1. Creating FDW extension with CREATE EXTENSION postgres_fdw; 2. Crea