Variables can be declared in a switch statement. You'll just need to declare them and use them within a new scope in the switch statement. For example,Example#include using namespace std; int main() { int i = 10; switch(i) { case 2: //some code break; case 10:{ int x = 13; cout
Kafka and Flume both are used for real time event processing system. They both are developed by Apache. Kafka is a publish-subscribe model messaging system. It can be used to communicate between publisher and subscriber using topic. One of the best features of Kafka is, it is highly available and resilient to node failures and supports automatic recovery.On the other hand, flume is mainly designed for Hadoop and it is a part of Hadoop ecosystem. It is used to collect data from different sources and transfer data to the centralized data store. Flume was mainly designed in order to collect ... Read More
To handle the mousedown and mouseup event with HTML5 Canvas,var mouseDown = false; // for mousedown canvas1.onmousedown = function(event){ dragOffset.x = event.x - mainLayer.trans.x; dragOffset.y = event.y - mainLayer.trans.y; mouseDown = true; } // for mouseup canvas1.onmouseup = function(event){ if(mouseDown) mouseClick(eevent mouseDown = false; }
Apache Kafka and Kinesis both software tool is to processing data stream in real time. Apache kafka is developed by linked-in and it is written in Scala and java. Kinesis is developed and managed by Amazon. It can be only used as a services.According to the amazon documentation −Amazon Kinesis Data Streams enables you to build custom applications that process or analyze streaming data for specialized needs. You can continuously add various types of data such as clickstreams, application logs, and social media to an Amazon Kinesis data stream from hundreds of thousands of sources. Within seconds, the data will ... Read More
OLAP stands for On-Line Analytical Processing. It is used for analysis of database information from multiple database systems at one time such as sales analysis and forecasting, market research, budgeting and etc. Data Warehouse is the example of OLAP system.OLTP stands for On-Line Transactional processing. It is used for maintaining the online transaction and record integrity in multiple access environments. OLTP is a system that manages very large number of short online transactions for example, ATM.Sr. No.KeyOLAPOLTP1BasicIt is used for data analysisIt is used to manage very large number of online short transactions2Database TypeIt uses data warehouseIt uses traditional DBMS3Data ... Read More
Monolithic architecture is built as one large system and is usually one code-base. Monolithic application is tightly coupled and entangled as the application evolves, making it difficult to isolate services for purposes such as independent scaling or code maintainability.It extremely difficult to change technology or language or framework because everything is tightly coupled and depend on each other.Microservices architecture is built as small independent module based on business functionality. In microservices application, each project and services are independent from each other at the code level. Therefore it is easy to configure and deploy completely and also easy to scale based ... Read More
ArrayBlockingQueue stores elements in FIFO order. Insertion of element always happened at the tail of the queue and removal of the element always happened from the head of the queue. It is thread safe and It is bounded array queue therefore once created, the capacity cannot be changed. It is the implementation of the Blocking queue.As per Java Docs −Resizable-array implementation of the Deque interface. Array deques have no capacity restrictions; they grow as necessary to support usage. They are not thread-safe; in the absence of external synchronization, they do not support concurrent access by multiple threads. Null elements are ... Read More
Blocking queue interface is the part of Java.util.concurrent package. Blocking queue is specially designed for producer consumer queues and also support collection. This interface is divided into four parts of methods to support all types of operation which can be performed over the queue. It doesn't accept null keys. ArrayBlockingQueue and LinkedBlockingQueue both implements Blocking queue interfaceArrayBlockingQueue and LinkedBlockingQueue both stores elements in FIFO order. In both queues Insertion of element always happened at the tail of the queue and removal of the element always happened from the head of the queue. Sr. No.KeyArrayBlockingQueueLinkedBlockingQueue1BasicIt is backed by ArrayIt is backed ... Read More
OAuth is designed for providing authorization of the third party without providing password. It is http based. OAuth provides an access token that can be exchanged for any supported assertion via an API.OpenId is designed for authentication. In openId third-party authenticate your users for you, by using accounts they already have. It is used to authenticate single sign-on identitySr. No.KeyOAuthOpenId1BasicOAuth is designed for providing authorization of the third party without providing passwordOpenId is designed for authentication.2SessionIt does not initiate user's session.OpenId initiate user's session3Access TokenIt used token concept to provide authorizationIn openId third-party authenticate your users for you, by using ... Read More
To display HTML5 client-side validation error bubbles, use the required attribute.You do not need to have JavaScript for client side validations like empty text box would never be submitted because HTML5 introduced a new attribute called required which would be used as follows and would insist to have a value: Enter email : Try to submit using Submit button
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP