Skip to main content

Posts

Example of New operator overloading,Call by value function and reference in c++

Example of New operator overloading in c++ const int maxnames = 5; class Names { char name[25]; static char Names::pool[]; static short int Names::inuse[maxnames]; public: Names(char* s = 0) { if (s) strncpy(name, s, sizeof(name)); } void* operator new[](size_t) throw(std::bad_alloc); void operator delete[](void*) throw(); void display() const { std::cout << name << std::endl; } }; // Simple memory pool to handle fixed number of Names. char Names::pool[maxnames * sizeof(Names)]; short int Names::inuse[maxnames]; // Overloaded new[] operator for the Names class. void* Names::operator new[](size_t size) throw(std::bad_alloc) { int elements = size / sizeof(Names); // Find the first empty element (if any). int p = -1; int i = 0; while ((i < maxnames) && (p == -1)) { if (!inuse[i]) p = i; ++i; } // Not enough room. if ((p == -1) || ((maxnames - p) < elements)) throw std::ba

Get Missing Index details from Activity Monitor Screen in SQL to get more performance

Create Missing index using SQL Activity Monitor to process improvement If you want to improve performance of application then keep view on activity monitor in SQL and go to long executed query line then you can see from recent expensive query window screen . You can see the average duration of query execution. To get Missing Index details from Activity Monitor Screen in SQL to get more performance you can do following steps. /* Missing Index Details from ExecutionPlan1.sqlplan The Query Processor estimates that implementing the following index could improve the query cost by 93.6536%. */ /* USE [DB_TEST] GO CREATE NONCLUSTERED INDEX [<Name of Missing Index, sysname,>] ON [dbo].[GENERALJOURNALACCOUNTENTRY] ([CREATEDTRANSACTIONID]) GO */ Once you get index you can create index by directly executing query or you can create index manually. You can create index in query execution process time is very high.

Solution for SQL Database Backup Restore Error

Sql Error Description Facing Below Error during Restoring of SQL Database to existing database or newly created database. Restore of database 'MicrosoftDynamicsAx' failed. (  Microsoft.SqlServer.Management.RelationalEngineTasks) System.Data.SqlClient.SqlError: BACKUP LOG cannot be performed because there is no current database backup. (Microsoft.SqlServer.SmoExtended) Solution : This Error due to you have take Full SQL Backup in Read only mode. To solve this issue you can try below steps. 1.U ntick tail log backup checkbox .If you don't know about Tail log backup option then search on google to know more about tail log backup. 2. Second option is you can take full backup of database again then restore then file on database then you can deleted backed up file to free the disk space.

Intranet and Extranet,Artificial Neural Networks,Server and Workstation

Intranet and Extra net An Intranet is a private network (LAN) that uses the TCP/IP protocol suite. However, access to the network is limited only to the users inside the organization. The network uses application programs defined for the global Internet such as HTTP, and may have web servers, print servers, file servers etc. Extra net Private network that uses the Internet protocol and the public telecommunication system Shares part of a business's information with suppliers, vendors, partners, customers or other businesses. Viewed as part of a company's intranet that is extended to users outside the company. Artificial Neural Networks ARTIFICIAL NEURAL NETWORKS •Neural Networks can supplement the enormous potential of traditional computers with the ability to make sensible decisions and to learn by experience. •Neural Computation is done by a dense mesh of computing nodes and connections. They operate collectively and simultaneously on data inputs.

Structured query language,SQL Query Processing

Structured query language The common commands and methods used in it are grouped into the following categories: Data Definition Language (DDL), Data Manipulation Language (DML), Data Control Language (DCL), Logical Connectors, Comparison operators, Aggregate functions, Joins, Sub query, Relational operators, Where clause etc. Data definition language covers SQL commands that create and destroy database tables. Data manipulation language covers SQL commands that create, change or destroy the information in a database table or the structure of the table. Data control language covers protection to the database such as granting access to the tables. Comparison operators cover those operators that allow for comparison between two items. Aggregate function deals with those standard SQL functions that allow programmers to narrow the search of a database. Joins category covers those items that allow information from two or more tables to be related. SQL Query Processing

Limitations of computer,Introduction of Internet

Limitations of computer 1. No Feelings: Computers are not living. Hence, can’t make judgment of its own. Its instructions are based on information given to it in form of program. 2. It is Dumb: Computer posses no intelligence of it’s own. It’s I.Q. is zero. Computer can’t take it’s own decision in this regard. Definition of  Internet Internet is a worldwide network that provides an infrastructure to connect universities, government offices, companies, students, scientists, researchers and private individuals. A machine to be on the Internet means it runs TCP/IP protocol stack, has an IP address, and has the ability to send IP packets to all the other machines on the Internet. A private individual having a personal computer can call up an Internet service provider using a modem, be assigned a temporary IP address, and send IP packets to other Internet hosts.  An Internet consists of a set of connected networks that act as an integrated whole. The Internet provides universal

Application Domain,Definition of SQL Server Integration Service(SSIS).

Application Domain Application domain is nothing but a process(not exactly as normal process) where the application will be running on it. Application domain will isolates all the applications by running each application in a diff. app domain. For instance, if 5 applications are running on your system, it will then creates 5 diff app domain to guarantee the security. It also has the following advantages, 1. An application can be independently stopped. 2. An application cannot directly access code or resources in another application. 3. A fault in an application cannot affect other applications. Definition of SQL Server Integration Service(SSIS). SQL Server Integration Services (SSIS) is one of the main issues of Microsoft BI (Business Intelligence) concept representing the data integration and data transformation in the enterprise level approach. SSIS (SQL Server Integration Services) has the ability to gather data from various resources in different kinds of formats, p

SQL Tips-Bulk insert records into table ,Select into ,Insert into,delete record in chunks,Remove unused space

Bulk insert records into table in sql  This is the way to Bulk insert records into table in sql or oracle insert into  If you want to insert of table data to existing table then you need to select insert into query. E.g. INSERT   INTO   Table2 SELECT   *  FROM   Table1 insert into dTable select * from sTable It mean table2 and table1 both exists before execution of query and its simply insert data line by line. It takes more time on execution. Select into: If you want to copy of table structure with data to new table then you need to select select into query. E.g. Select * into tab1 from tab2. It means tab2 exists and tab1 does not exist in database before execution of query. After execution it will copy data of tab2 to tab1 and it will create table tab1 also. if dTable is blank and doesn't have any record. Create this as follows: definately reduce the time. CREATE TABLE dtable NOLOGGING AS SELECT * FROM stable Example of delete records from sq

Command to know the incoming network connections,transmitting data to server in unix

Command   to know the incoming network connections in unix   to know a command which would help knowing the incoming network connections through(from & to) different ip-address:ports netstat -anp | grep "port" | grep "process" Transmitting data to server through code in linux int no_of_bytes_to_send; char* buffer[100]; no_of_bytes_to_send=sizeof(buffer); while(no_of_bytes_to_send>0) { int byte_send = send(sd,buffer,no_of_bytes_to_send); no_of_bytes_to_send = no_of_bytes_to_send - byte_send; buffer+=byte_send; }

Code To Fill data table in DataGrid,fill static, get DataSet combo in asp.Net

Code To Fill DataGrid using asp.net  You can try Code To Fill DataGrid using asp.net common class. After creation these methods you need to call these method to your form editors by creating class object. Fill DataGrid Private Sub fillgrid() dim dta2 as New dataTable Dim str1 As String = "select * from receipt_detail " Dim datatb As New DataTable datatb = obj.OpenDataTable(str1, "receipt_detail") dta2.DataSource = datatb dta2.DataBind() End Sub 'Other Related Function Public Function OpenCn() As Boolean Try If cn Is Nothing Then cn = New SqlConnection End If If Not (cn.State = ConnectionState.Open) Then cn.ConnectionString = constr cn.Open() End If Finally End Try Return True End Function Public Function Closecn() As Boolean Try If Not (cn Is Nothing) Then cn.Close() End If Finally cn.Dispose() End Try Return True End Function Public Function OpenDataTable(B

Workbook Data Into One Single Sheet,Sort Alphabetic​ally ,Row column height width manipulation -MS Excel

Workbook Data Into One Single Sheet using MS Excel  If you have 10 workbook each workbook have single sheet of data (tab name should be anything) if you need consolidation sheet into all 10 workbook into one then you can do this with code use below mention code and your work will done . Sub test() Dim FS, Fle, FLDR, fles Dim Fletype As Variant Set FS = CreateObject("scripting.filesystemobject&quot ;) Dim intLstrow As Integer Dim intLstcol As Integer Dim dlgDialoge As FileDialog Dim srcsheet As Worksheet Dim wk As Workbook 'Set dlgDialoge = Application.FileDialog(msoFileDialogFolderPicker) Set wk = ThisWorkbook Set FLDR = FS.getfolder(BrowseFolder) Set fles = FLDR.Files For Each Fle In fles Fletype = Split(Fle.Name, ".") If (Fletype(UBound(Fletype)) = "xls" Or Fletype(UBound(Fletype)) = "xlsx") Then Set srcsheet = Workbooks.Open(Fle.path).Worksheets(1) intLstrow = srcsheet.Range("

Create or replace trigger before insert on field in sql

1.Create  or replace trigger before insert on field in sql Create or replace trigger t1 Before insert on Employee For each row declare v_firstname Employee.firstname%type; v_lastname Employee.lastname%type; Begin DBMS_OUTPUT.PUT_LINE('You inserted the first Name:'|| :NEW.FIRSTNAME); DBMS_OUTPUT.PUT_LINE('You inserted the first Name:'|| :NEW.LASTNAME); Begin select distinct firstname into v_firstname from Employee where firstname=:NEW.FIRSTNAME; IF(:NEW.FIRSTNAME = v_firstname) THEN DBMS_OUTPUT.PUT_LINE('This first name exists already in the table Employee.'); end if; exception when no_data_found then DBMS_OUTPUT.PUT_LINE('This first name does not exist in the table Employee.'); End; Begin select distinct lastname into v_lastname from Employee where lastname=:NEW.lastNAME; IF(:NEW.LASTNAME = v_lastname) THEN DBMS_OUTPUT.PUT_LINE('This last name exists already in the table Employee.