Technology Questions

Q:

How to set cookies?

Answer

setcookie('variable','value','time');
variable - name of the cookie variable
value     - value of the cookie variable
time       - expiry time

Example:
<?php
setcookie('Test',$i,time()+3600);
?>
Test - cookie variable name
$i - value of the variable 'Test'
time()+3600 - denotes that the cookie will expire after an one hour

Report Error

View answer Workspace Report Error Discuss

Subject: PHP

0 2635
Q:

What is the difference between class and structure?

Answer

Structure: Initially (in C) a structure was used to bundle different type of data types together to perform a particular functionality. But C++ extended the structure to contain functions also. The major difference is that all declarations inside a structure are by default public.
Class: Class is a successor of Structure. By default all the members inside the class are private.

Report Error

View answer Workspace Report Error Discuss

Subject: C++

0 2633
Q:

How can we achieve singleton pattern in iOS?

Answer

The Singleton design pattern ensures a class only has one instance, and provides a global point of access to it. The class keeps track of its sole instance and ensures that no other instance can be created. Singleton classes are appropriate for situations where it makes sense for a single object to provide access to a global resource.Several Cocoa framework classes are singletons. They includeNSFileManager, NSWorkspace, NSApplication, and, in UIKit,UIApplication. A process is limited to one instance of these classes. When a client asks the class for an instance, it gets a shared instance, which is lazily created upon the first request.

Report Error

View answer Workspace Report Error Discuss

Subject: IOS

3 2630
Q:

Explain the difference between star and snowflake schemas.

Answer

Star schema: A highly de-normalized technique. A star schema has one fact table and is associated with numerous dimensions table and depicts a star.


Snow flake schema: The normalized principles applied star schema is known as Snow flake schema. Every dimension table is associated with sub dimension table.


 


Differences:


- A dimension table will not have parent table in star schema, whereas snow flake schemas have one or more parent tables.


- The dimensional table itself consists of hierarchies of dimensions in star schema, where as hierarchies are split into different tables in snow flake schema. The drilling down data from top most hierarchies to the lowermost hierarchies can be done.

Report Error

View answer Workspace Report Error Discuss

0 2630
Q:

What is the functionality of the function strstr and stristr?

Answer

strstr() returns part of a given string from the first occurrence of a given substring to the end of the string.
For example:
strstr("user@example.com","@") will return "@example.com".

stristr() is idential to strstr() except that it is case insensitive.

Report Error

View answer Workspace Report Error Discuss

Subject: PHP

0 2630
Q:

What is Data warehousing?

Answer

Data warehousing is a process of repository of electronic data of an organization. For the purpose of reporting and analysis, data warehousing is used. The essence concept of data warehousing is to provide data flow of architectural model from operational system to decision support environments. 

Report Error

View answer Workspace Report Error Discuss

0 2615
Q:

What is IUnknown and what are its three parts?

Answer

IUnknown as an interface of a COM object. Every COM object has to support IUnknown, besides optionally adding other interfaces.


IUnknown is made of QueryInterface, AddRef and Release.

Report Error

View answer Workspace Report Error Discuss

0 2614
Q:

What is Thread?

Answer

A Thread is a block of code that can be executed in parallel with another block of code.

Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 2614