Author Archives: Ajitesh Kumar
Angular – How to Get Started with Unit Test
This blog represents code sample on how to get started with unit test in an Angular app (Angular 2/Angular 4). The code sample shown below could be used as a template for creating a unit test spec for any component. Unit Test Code Sample for Angular Component Pay attention to following two points: Need to declare component which needs to be tested; In the code shown below, it is the SignupComponent which is tested. Note that SignupComponent represents template-driven form for Signup. In another example, the unit test for AppComponent is shown. Need to declare the modules which are required for testing the component; In the unit test code given …
How to Get User Inputs in Angular – Code Samples
This blog represents tips/techniques and code samples on how to get user inputs in Angular template-driven forms in an Angular app (angular 2/angular 4). Following represents techniques when using template reference variable such as #fieldName with input element. (keyup)=”methodName(fieldName.value)” (keyup.enter)=”methodName(fieldName.value)” (blur)=”methodName(fieldName.value)” Technique 1: (keyup) = “methodName(fieldName.value)” Event keyup helps capture user inputs after every keyup event. The following is the template code: The following is the component code: Technique 2: (keyup.enter) = “methodName(fieldName.value)” Event keyup.enter helps capture user inputs after enter/return button is pressed. The following is the template code: The following is the component code: Technique 3: (blur) = “methodName(fieldName.value)” Event blur helps capture user inputs when user entered some …
Interview Questions – Angular User Input Form Handling
This page represents interview questions in relation to the usage of basic primitives which can be used for handling user input and gestures while working with Angular forms. It covers some of the following topics: Usage of $event object for capturing user inputs Usage of template reference variable for handling user inputs Best practices in relation with using $event object or template reference variables Syntaxes in relation with both $event object and template reference variables [wp_quiz id=”5394″] In case you are developing web apps using Spring and Angular, check out my book, Building web apps with Spring 5 and Angular. Grab your ebook today and get started.
Blockchain – Top 6 Bitcoin Blockchain Explorer
The following are some of the Bitcoin blockchain explorer web applications which can be used to search the transactions, addresses, and blocks and determine the relationships between them. Blockchain Info Bitcoin Block Explorer Insight Bitpay BlockCypher Blocktrail BTC NeoTrackerd Pay attention to some of the following: Height: Height of the block (491105); It implies that 491104 blocks have already been added. Age: Block got created 5 minutes back Transactions: Number of transactions included in the block Size: Size of the block Relayed By:
Sample Bitcoin Block of Bitcoin Blockchain
This blog represents a sample bitcoin block of a Bitcoin Blockchain. Read greater details from this Oreilly book, Mastering Bitcoin. Pay attention to some of the following: Block file format: The block is represented as a file in JSON format Merkle root: Merkle root represents the hash of the root of merkle tree created as a result of combining hash of children nodes. Leaf of the merkle tree represents the hash of the transaction. It takes up 32 bytes of storage. It forms part of Block header. Time: Timestamp when the block is created. It takes up 4 bytes of storage. Forms part of block header. Difficulty: Represents difficult target and takes …
Blockchain Developers Interview Questions – Set 2
This page provides quiz (interview questions) for Blockchain Developers. These are questions, primarily, related with Bitcoin Blockchain. Some of the topics covered are following: Merkle tree Block Mining [wp_quiz id=”5366″]
Spark – How does Apache Spark Work?
This blog represents concepts on how does apache spark work with the help of diagrams. Following are some of the key aspects in relation with Apache Spark which is described in this blog: Apache Spark – basic concepts Apache Spark with YARN & HDFS/HBase Apache Spark with Mesos & HDFS/HBase Apache Spark – Basic Concepts The following represents basic concepts in relation with Spark: Apache Spark with YARN & HBase/HDFS Following are some of the key architectural building blocks representing how does Apache Spark work with YARN and HDFS/HBase. Spark driver program runs on client node. YARN is used as cluster manager. As part of YARN setup, there would be multiple nodes running …
Hyperledger Network Certificates & How to Create Them
This blog represents code samples and related concepts on how to create hyperledger network certificates. These certificates will be used by peer nodes in Hyperledger Blockchain network. Crypto Config file for Generating Hyperledger Network Certificates Following is a YAML configuration file which can be used to create certificates for different network entities in the blockchain network. You can save the file with name such as crypto-config.yaml Pay attention to some of the following in above file: There are two high-level entries for organizations managing orderer node and peer nodes. They are OrdererOrgs and PeerOrgs Each org would be defined with attributes such as name, domain, specs, templates, users etc. Specs entry …
Hyperledger Fabric – Hello World with Blockchain Network
Hyperledger Fabric Hello World is about building your first blockchain network. We will make use of fabric-samples provided by Hyperledger. The first Blockchain network will be built using Docker containers. The first network will result in running containers representing some of the following: Two peer nodes each, representing two different organizations. Thus, one organization will have two peer nodes, one of which is called an anchor node and is used to ensure availability. For two organization, there will be four nodes. One node representing Ordering service Management node to do some of the following activities: Join peers to a channel Deploy and instantiate chain code Drive execution of transactions against deployed …
Docker – Shell Script to Remove Docker Images
Following script could help remove all of the docker images starting with a specific prefix. Save the script in a file namely, rmImages.sh. Change the permission using the command such as “chmod u+x rmImages.sh”. Execute the script using the command such as ./rmImages.sh. And, that is it. it would help you delete all the images starting with a specific prefix.
Docker – Script to Remove Running Containers
Following script could help remove all the running Docker containers. Save the script in a file namely, delContainers.sh. Change the permission using command such as “chmod u+x delContainers.sh”. Execute the script using the command such as ./delContainers.sh. And, that is it. it would help you delete all the containers.
Blockchain – Top Links for ICO
Following are some of top links representing the pages which provides good information on ICO (Initial Coin Offering): What is ICO? List of upcoming ICOs, token sales, past ICOs etc – ICOAlert.com Up-to-date news on ICO – Cointelegraph.com ICO Tracker from Coindesk.com Ultimate list of ICO resources from Coindesk.com
Blockchain Developers Interview Questions – Set 1
This page covers interview questions for Blockchain developers. It covers some of the following concepts in relation with Bitcoin Blockchain: Blockchain fundamentals Block related concepts [wp_quiz id=”5361″]
Kubernetes – When to use Which ServiceTypes?
Kubernetes supports different kinds of service types such as following: ClusterIP: The service of type, ClusterIP, can only be exposed to other services running within the same Kubernetes cluster. The default ServiceType is ClusterIP. NodePort: The service of type, NodePort, can be exposed externally at a static port. The service address would look like NodeIP:NodePort. External APIs can invoke the NodePort services. LoadBalancer: The service of type, LoadBalancer, can be exposed externally using cloud providers’ load balancer. ExternalName: The service of type, ExternalName, is mapped to an external name, such as helloapp.vitalflux.com.
Kubernetes – Port, Targetport and NodePort
When working with Kubernetes Service, you will come across some of the following terminologies: Port: Port is the port number which makes a service visible to other services running within the same K8s cluster. In other words, in case a service wants to invoke another service running within the same Kubernetes cluster, it will be able to do so using port specified against “port” in the service spec file. Target Port: Target port is the port on the POD where the service is running. Nodeport: Node port is the port on which the service can be accessed from external users using Kube-Proxy. Take a look at following spec defining a …
I found it very helpful. However the differences are not too understandable for me