Posts

Javascript undefined vs null

  Today I am going to talk about the difference between javascript’s two of most famous primitive values, undefined and its counterpart null.  Let's explore together what the differences are between null and undefined.  Null The value null represents the intentional absence of any object value. Null must be assigned.  An interesting thing about null is that it expresses a lack of identification, indicating that the variable points to no object.  Undefined A variable that has not been assigned a value is of type undefined. A method or statement returns undefined if the evaluating variable does not have an assigned value A function returns undefined if a value is not returned Analogy To Understand :  A metaphor or example scenario will help us to understand the underlying concept more thoroughly.   Let's imagine that you need to fill up an important form of some kind.   You are also handed the same form which is being already filled to help you out. When you are reading through t

Electron - How to load/update the current browser window with a new html file?

Image
 A couple of days ago my superior of my current job told me to create a cross-platform desktop application with certain requirements. After some digging, I came to know about electron js which is currently the most popular javascript framework to create a cross-platform desktop app with HTML, CSS, and Javascript. At first, I was thinking to start the development process with the help of some front-end framework like Vue or angular along with electron. But after some time I made a decision to dig deep into electron first without getting my hand dirty with those front-end frameworks.  Oh boy, that was quite a decision.  After some quick digging in official electron docs, I faced a problem of changing the entire view aka changing the source Html file of the current browser window. It's easy a create a new browser window instance but changing the source file of the current browser window at runtime is a little bit complicated but not that much. I googled a lot to find a solution but di

Difference between __dirname vs __filename vs process.cwd() : once and for all

Image
Recently I started working with nodejs, one of the most popular backend technologies in today's era. After spending some time with nodejs , I quickly realised that I am facing some difficulties figuring out the tiny differences among three of node's global objects, i.e __dirname, __filename and process.cwd . The main reason of causing this confusion is that they are closely related to each other and behave almost equally in certain scenarios. That's why I sat down today to clear the confusion and figure out the differences . This post is about writing down all those details for future references and helping out people who are in the same shoe now, in the past or in the near future. At first lets see what the official documentation of node says about these three global objects. __dirname It will return the directory name of the current module. I like to remember it as it returns the absolute directory path of the script or js file (the one which we run using node com

Violation of Inappropriate Ads Policy : One Stop Solution

Image
If you are like me who recently gets an inappropriate ad violation policy notice from google play and as a result of it , google play removed your app from play store, then we are in the same ship and there is no doubt that this post is written for you people. Google does like to play with us a lot , I must say it's a learning for me as I am getting more acquainted with all those hidden policy violations. It does increased my knowledge a lot while trying to find the solution for this kind of problem. Well, enough jibber jabber, lets dive into the main solution part. In this post I will show you how you can get rid of this mighty policy violation and put your app back on play store. What it looks like Here is the glimpse of an email regarding ad violation policy in case you are not sure what I am talking about. What's the effect If you don't take actions within one day then you will also get an admob action required as a consequence of this policy violation error

Azure Sql Firewall Configuration

Image
In this post I will show you how to configure firewall settings for Azure SQL server in order to connect from your local development machine or from some remote machine where your application is hosted. More or less, the process is same. What is firewall, in azure's case IP firewall Technically speaking, firewall is a software program which prevents unauthorized access to your system. We can think of firewall as a bouncer waiting outside of the midnight party club. The bouncer only allows the spectators to pass through the club's door whoever has the pass/invitation to join the party.  Pretty cool, huh. As network traffic passes through the firewall, the firewall decides which traffic to forward and which traffic not to forward, based on rules that we have defined. In azure SQL we have to add some firewall rules for allowing trusted users to pass through the wall of winterfell. In azure world , the users who can have access to SQL server are called clients. By allowi

Google play console configuration for IAP, Part 1

Image
No doubt, configuring In-app purchase inside google play console is a long, tiresome process. This is particularly true if you are just starting out or new to this In-app purchase world. I will try my best to explain the steps needed for the configuration of in app purchase. From now on we will call this IAP as this saves some typing for me, hope you guys don't mind on that. However,  covering the full procedure in a single post is not going to be suitable for readers. That's why I am breaking the full procedure in a series of posts and this article is the first one of them. To successfully test & publish app with in app purchase, we need to do following Download and integrate in app billing library inside the code of your android app Upload that app to play console Configure for in app purchase inside play console Setup sandbox/test environment in order to test the app with IAP What I am not going to discuss or write about How to code or integrate in app

SQL Query : Part 1

You are probably thinking that this is going to be another sql query tutorial. Well the answer is both yes and no. I am tired of searching and reading all those sql tutorials again and again where each of this tutorials explain all those concept from top to bottom, which I don't need. We programmers easily forgot sql query syntax but not the concept. So I created my own list to save a lot of searching time. I am not posting all queries in a single post. I had divided all queries into several parts. This is the first part. I am using mysql for the RDMS. I also includes some common mysql command along with sql queries. This post only contains queries which includes database creation, table creation, view data from table. Start mysql server mysql -u root -p This command will prompt for password,  enter the password you set for your local mysql server. Resetting root user password for mysql server ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass&