Wednesday, January 29, 2020

RxJS library

Reactive programming is an asynchronous programming paradigm concerned with data streams and the propagation of change. RxJS (Reactive Extensions for JavaScript) is a library for reactive programming using observables that makes it easier to compose asynchronous or callback-based code. RxJS is a library for composing asynchronous and event-based programs by using observable sequences. It provides one core type, the Observable, satellite types (Observer, Schedulers, Subjects) and operators inspired by Array#extras (map, filter, reduce, every, etc) to allow handling asynchronous events as collections.
RxJS provides an implementation of the Observable type, which is needed until the type becomes part of the language and until browsers support it. The library also provides utility functions for creating and working with observables. These utility functions can be used for:
  • Converting existing code for async operations into observables
  • Iterating through the values in a stream
  • Mapping values to different types
  • Filtering streams
  • Composing multiple streams
The essential concepts in RxJS which solve async event management are:
  • Observable: represents the idea of an invokable collection of future values or events.
  • Observer: is a collection of callbacks that knows how to listen to values delivered by the Observable.
  • Subscription: represents the execution of an Observable, is primarily useful for cancelling the execution.
  • Operators: are pure functions that enable a functional programming style of dealing with collections with operations like map, filter, concat, reduce, etc.
  • Subject: is the equivalent to an EventEmitter, and the only way of multicasting a value or event to multiple Observers.
  • Schedulers: are centralized dispatchers to control concurrency, allowing us to coordinate when computation happens on e.g. setTimeout or requestAnimationFrame or others.

Friday, December 20, 2019

Blockchain

A blockchain is a growing list of records, called blocks, that are linked using cryptography. Each block contains a cryptographic hash of the previous block, a timestamp, and transaction data. At its most basic level, blockchain is literally just a chain of blocks, but not in the traditional sense of those words. When we say the words “block” and “chain” in this context, we are actually talking about digital information (the “block”) stored in a public database (the “chain”).
Blockchain is a cryptographically secured, time-stamped, public and distributed database of every bitcoin transaction that has ever occurred on the network. "Distributed" here means that the information in the blockchain is broadcast to and recorded by every node in the network. There is no one central database. Any user can refer to this list of transactions and check exactly what how many bitcoins have ever belonged to any specific address at any point in time. This way the system is transparent, double-spending is prevented, and there is no need for a trusted central authority.
The goal of blockchain is to allow digital information to be recorded and distributed, but not edited. That concept can be difficult to wrap our heads around without seeing the technology in action, so let’s take a look at how the earliest application of blockchain technology actually works.
Blockchain technology was first outlined in 1991 by Stuart Haber and W. Scott Stornetta, two researchers who wanted to implement a system where document timestamps could not be tampered with. But it wasn’t until almost two decades later, with the launch of Bitcoin in January 2009, that blockchain had its first real-world application.

Friday, November 1, 2019

Integrate Qlik Sense with Web Application

Qlik Sense apps, sheets and visualizations can be embedded in for example:
  • Portals
  • Web applications
  • Intranet and Extranet sites
There are different ways of embedding the Qlik Sense content:
  • iFrame integration using the URL Integration APIs
  • Div integration using the JavaScript libraries
  • Standard Qlik Sense charts and custom visualization extensions can be created programmatically without having to be built in the Qlik Sense UI first, using the qlik-visual web component
Mashups overview
In the context of web development, a mashup is a web page or web application that uses content from more than one source to create a single new service displayed in a single graphical interface.
The Capability APIs enable you to easily and quickly integrate with your Qlik Sense objects to produce enriched results that were not necessarily the original reason for producing the source app in Qlik Sense. You can reuse Qlik Sense visualizations, including your custom extensions, and you can also make use of Qlik Sense data and calculations.
By using active content, your visualizations are updated when state changes. You can also subscribe to data and change the state through the visualizations.
In short it works like the following:
    You open a WebSocket to Qlik associative engine using the qlik.openApp method.
    Objects use the same WebSocket, that is the same session, which means they are connected.
    Qlik Sense objects work just as they do in the Qlik Sense client.

Tuesday, October 22, 2019

Qlik

Qlik (formerly known as Qliktech) is a software company whose main products are QlikView and Qlik Sense, both software for business intelligence and data visualization.
Qlik View:
QlikView is a data analysis and visualization tool which enables users to fetch, integrate, process and analyze data from varied sources. We can use it for developing data models, analytical applications, dashboards, visualizations to create analytical reports and deliver it to end-users via Access point. Through the access point, end-users can access data, carry out searches, create data models, associations, visualizations etc. to analyze data and discover data trends.
Features of QlikView
    Dynamic BI ecosystem (Interaction with dynamic apps and dashboards)
    Default and custom connectors
    Data visualizations
    Capable of building guided analytics applications and dashboards
    Guided and advanced analytics

Qlik Sense:
Qlik Sense is a self-service data discovery and analysis tool which focuses on ease of use for the user. It provides a modern and interactive user interface where you can use the tools for modeling and managing data, creating visualizations, layouts, and stories. It is not very technical in its approach and thus very user-friendly.
Features of Qlik Sense:
    Smart search options like Google and associative functions
    Fast and reliable connections to multiple data sources
    Drag and drop visualizations
    Generate personalized reports and detailed, interactive dashboards
    Self-service data discovery

Friday, September 6, 2019

HttpClient - a closer look (C#.Net)

HttpClient is the new and improved way of doing HTTP requests and posts, having arrived with .Net Framework 4.5. It provides a base class for sending HTTP requests and receiving HTTP responses from a resource identified by a URI.
HttpClient is preferred over HttpWebRequest due to async methods available out of the box and you would not have to worry about writing begin/end methods. Basically when you use async call (using either of the class), it will not block the resources waiting for the response and any other request would utilize the resources to make further calls. Another thing to keep in mind that you should not be using HttpClient in the 'using' block to allow reuse of same resources again and again for other web requests.
Recommend use:
  • If all the operations for a service share the same set of default headers, then have an instance of HttpClient for each endpoint that your application is communicating to.
  • If an endpoint requires different header for each HTTP method, then you’ll need to create an instance of HttpClient for each combination of verb+ endpoint.
These client classes should be made Singleton across the application or the HttpClient variable should be declared private static readonly within the Client class. This will allow you to:
  • Benefit from the performance optimizations provided by connection pooling;
  • Avoid running out of available ports due to connections in TIME_WAIT state if the server gets heavy load;
  • Use default BaseAddress and HTTP Headers for each service your application integrates to
If you are getting either below errors, you may need to check the default security protocol used by HttpClient:
  • One or more errors occurred.
  • An error occurred while sending the request.
  • The underlying connection was closed: An unexpected error occurred on a receive.
  • The client and server cannot communicate, because they do not possess a common algorithm.
To resolve this issue, you can use:
using System.Net;
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;
As,
  • It needed for .Net 4.5 because Tls12 is not a default protocol.
  • You need to write the above code only once within the application. (For example within Global.asax > Application_Start within Web application or equivalent in Winforms application)
  • For .Net 4.6 and above, Tls12 is a default protocol so it is not needed.

Wednesday, August 14, 2019

Data Warehouse vs Database

Data warehouses and Databases are both relational data systems, but were built to serve different purposes. A data warehouse is built to store large quantities of historical data and enable fast, complex queries across all the data, typically using Online Analytical Processing (OLAP). A database was built to store current transactions and enable fast access to specific transactions for ongoing business processes, known as Online Transaction Processing (OLTP).
ParameterDatabaseData Warehouse
PurposeIs designed to recordIs designed to analyze
Processing MethodThe database uses the Online Transactional Processing (OLTP)Data warehouse uses Online Analytical Processing (OLAP)
UsageThe database helps to perform fundamental operations for your businessData warehouse allows you to analyze your business
Tables and JoinsTables and joins of a database are complex as they are normalizedTable and joins are simple in a data warehouse because they are denormalized
OrientationIs an application-oriented collection of dataIt is a subject-oriented collection of data
Storage limitGenerally limited to a single applicationStores data from any number of applications
AvailabilityData is available real-timeData is refreshed from source systems as and when needed
UsageER modeling techniques are used for designingData modeling techniques are used for designing
TechniqueCapture dataAnalyze data
Data TypeData stored in the Database is up to dateCurrent and Historical Data is stored in Data Warehouse May not be up to date
Storage of dataFlat Relational Approach method is used for data storageData Ware House uses dimensional and normalized approach for the data structure Example: Star and snowflake schema
Query TypeSimple transaction queries are usedComplex queries are used for analysis purpose