Posts

WiFi adapter not found issue in Ubuntu 20.04

I was facing "WiFi adapter not found" issue in my Ubuntu 20.04 installation on Sony VAIO laptop. I had followed multiple steps but it did not resolve issue. Following steps are something which helped me. sudo apt update sudo apt upgrade sudo apt update-pciids sudo install firmware-b43-installer sudo reboot sudo install firmware-b43-installer sudo apt-get update sudo apt-get upgrade sudo apt-get install --reinstall bcmwl-kernel-source sudo reboot I have tried and executed few of steps multiple times, I'm not aware of the reason but above steps should work. Make sure there is no error displayed in steps above. This post helped me identify few of the steps.

Caching mechanisms in modern world browser

Image
           Getting data locally is always faster than the getting data from server. There are different types of caching mechanism that can be used to cache data on browser for optimizing performance and faster data retrieval. We will see some of the data store that can be used on client to cache or store data. 1. Session Storages     This is a very well-known storage on browser. Commonly uses to session specific data on this store. We can infer a current tab as one session. Session storage will not be available across tabs or new tab. Maximum limit of of session storage is 5MB.     Limitations:     It cannot use to persist information across tab or sessions     It cannot store data more than 5MB.     Data is not secure. Additional effort need to secure data stored 2. Local storage     Local storage is also a very well-known storage. This is u...

How to do AJAX using XMLHttpRequest for large data

Your are at right place if you are : working on loading huge amount of data from server be it JSON or XML document getting truncated JSON Response string  observing $.ajax call failure due to JSON.parse is compiling about invalid char while parsing JSON  observing performance lag while parsing JSON using $.ajax observing response code 200 but there is not response received in $.ajax success call  Uncaught InternalError: allocation size overflow in $.ajax If you are loading large data from server then you need to consider lot of factors impacting load time. There can be optimization on server as well as client. Coming to client, most commonly used API for AJAX is JQuery.ajax. But when it comes to fetching large data set from server be it in JSON format or XML document, you might end up facing issue mentioned at the beginning of this blog. I observed that in case of large JSON String in response, response string is being truncated. Also, if string is not truncated, JSON.par...

General Linux commands

Checking OS flavor and version of Linux      cat /etc/os-release Create Fedora GUI      yum grouplist      yum groupinstall "X Window System"      init 5 Create VNCServer session     vncserver Create VNC password     vncpasswd Remove VNC session      vncserver -kill :2 If GUI is not shown in VNC then https://www.youtube.com/watch?v=B6et8JZFylA  vi /home/tsutrave/.vnc/xstartup Uncomment below 2 line and the do vncserver #unset SESSION_MANAGER      #exec /etc/X11/xinit/xinitrc [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey vncconfig -iconic & xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & twm &

Null, undefined and empty checks in JavaScript

Whenever you are writing code in Javascript, the Most common point comes where you and your code reviewer comes to a point to write fail-safe code. When we are talking about fail-safety, the prominent use case comes to check null, undefined, and empty text values. It is very important to handle these values in order not to come across a code failure at runtime. If there are use cases where your variables attain null or undefined you will be in a position to understand and handle it. In JavaScript, the state with no value is represented by  null   or  undefined . It is one of the  primitive values . The most common way to handle the null value is to just put the variable in if condition check. var myVariable = null; //typeof null is "object" and treated falsy if(myVariable){ //resolves to false as value is null console.log(‘I will not print if the value is null.’); } Similar to null, undefined is also treated as falsy. The difference between undefined and null...

ManagedExecutorService JNDI configuration in REDHAT JBoss Enterprise Application Platform

Image
This blog will cover the JNDI configuration of ManagedExecutorService in Redhat JBoss EAP. Login to the JBoss Admin Console Go to Configuration >> Subsystems >> EE and click on Views. This will take you to Executor configuration Screen. You will find default configuration for Executor service. JNDI Name is configured as "java:jboss/ee/concurrency/executor/default". Now, you are set start consuming this JNDI name to consume Executor service. try { javax.naming.InitialContext context = new javax.naming.InitialContext(); javax.enterprise.concurrent.ManagedExecutorService service = (javax.enterprise.concurrent.ManagedExecutorService)context.lookup("java:jboss/ee/concurrency/executor/default"); Future f = service.submit(new ThreadProcessor()); //ThreadProcessor is callable or runnable thread } catch (NamingException e1) { e1.printStackTrace(); }

Top most used GIT commands

Checkout GIT repository in current folder git clone <repository name> . Checkout GIT repository in current folder git checkout -b <new branch name> Push new branch changes to remote repository git push origin  <new branch name> Cherry pick code git cherry-pick <Commit hash string> list all the un-tracked files git clean -n Remove all the un-tracked files git clean -f Remove all the un-tracked files and directories git clean -f -d Delete branch git branch -d <branch Name>              /* local branch */ git branch -D <branch Name>               /* for delete local + remote branch */ Applying stash git stash apply <Stash with index> List all Stash available git stash list Abort merge in progress, this reverts all the files from abort git merge --abort Abort cherry pick that is in progress git cherry-pick --abort Checkout main branch gi...

Most common MySQL or MariaDB commands for Web Developers

Create Database    create database <Database Name>; Selecting a Database   Use <Database Name>; List all tables in Database   show tables; Create User table CREATE TABLE USER ( ID int NOT NULL, NAME varchar(100) NOT NULL, EMAIL_ADDRESS varchar(100), PRIMARY KEY (ID) ) Or  CREATE TABLE USER ( ID int NOT NULL AUTO_INCREMENT, NAME varchar(100) NOT NULL, EMAIL_ADDRESS varchar(100) NOT NULL, SALARY double DEFAULT NULL, NOTE text, PRIMARY KEY (ID) )

Connecting MariaDB using JDBC

Assumption :      You have MariaDB and Client installed. Steps:      Run client and create database using command "create database".       create database test;      Now, connect to that database using "USE" command       Use test;      Create new table USER with following command       CREATE TABLE USER (       ID int NOT NULL,       NAME varchar(100) NOT NULL,       EMAIL_ADDRESS varchar(100),       PRIMARY KEY (ID)       )      Now, download the driver from mysql site. I'm using "mysql-connector-java-5.1.46". MySql and MariaDB are similar so for basic connectivity mysql drivers works. Class.forName("com.mysql.jdbc.Driver"); java.sql.Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "password"); Prepare...

Polymorphism in Java OOP

Image
Polymorphism is word made from two words "Poly" which means many and "morph" means shape/form. Polymorphism means "ability to take multiple shapes or forms". In Java, method and Object both takes multiple forms. There are two forms of polymorphism : Compile time Polymorphism Run time Polymorphism Compile time polymerphism Compile time polymorphism is achieved using method overloading. Method will have same signaturre(name) but different parameters.This method is bound statically with method name and input parameter type hence static binding. Output : Display String Display int Runtime Polymorphism Method overriding is used to achieve Runtime polymorphism. Method will be overridden in subclass. This method is resolved depending on Object instance dynamically at runtime. Output : Display of Display Unit. Display of Monitor.

Inter Thread Communication(Producer-Consumer Problem) simplified

Image
Inter thread communication is very interesting topic where you learn how two thread can talk to each other in a multi-threaded environment. And this is demonstrated with a very simple example of Producer-Consumer problem. Object class's wait and notify method will be used for inter thread communication. I'm assuming two thread Producer Consumer These will be spawned using main thread. Producer will try producing Product. Produce action will be represented by making Available property in Product Object true.  And consumer will be consuming that object by making available property false.  Same object will be used to pass to both threads for inter thread communication Code accessing same object will be synchronised  Main methods used are : Thread.sleep >> It will be used to give some delay so that we can understand code execution. Object.wait >> Wait will be called on product which will make current thread to release lock and wait. Object...

Mixed-Content error for https request making http request

You might have seen mixed-content error while page rendered with HTTPS is making HTTP request. Your server is configured to SSL or to serve only HTTPS request. Server will block HTTP request mostly in this case unless configured so.  Active Mixed Content : It has access to all DOM in current HTML page. I can manipulate page. It can cause man-in-the-middle attack. JavaScript source, CSS source, link, XMLHttpRequest can cause such content. Passive Mixed Content : It is content which does not alter other parts of HTML page.Static image, audio, video link are cause of passive mixed content. You can quickly fix such errors by addressing following points : Use relative URL if content/resource hosted on same server If you are calling content from servlet/JSP/REST API, use relative URL load resources. If absolute URL is used, then make sure all entries for resource URL has HTTPS. make sure you are creating URL starting HTTPS If cross domain is used then use site whi...

Creating your own Weblogic local domain on Windows

Image
Creating your own Weblogic local domain on Windows If you want create your own weblogic domain you have reached correct destination. You can use this domain for configuring server in Netbeans IDE. This installation is on OS Windows 7. Let's jump to configuring domain. 1. Go to Weblogic configurator and select Quick Launch 2. You will see quick launch screen one like below. Now click on "Getting Started with Weblogic 10.3.6". 3. Now you will see Configuration Wizard screen as below. Select "Create new Weblogic Domain". And click on Next. 4. You can select domain source as below. Configurator wizard will list all the domains. 5. Enter name and location in next screen. 6.Add username and password. Keep password alphanumeric one, should be combination of Letters and numbers like "Welcome1". This is important for logging in to admin console. 7. This is very important step. If you are using this in some IDE then select develop...

Adding default help provider to ADF application

Please read about HelpProvider documentation from ADF Docs. Now you can go and implement your default help provider in ADF App. Whenever there is requirement to override default behavior of the help topic text and basically want to override behavior to accept any random help text from ELExpressions. Here we need to override some classes and make few configuration entries in adf-settings.xml file. 1. Extend HelpTopic class and override methods. Code should look something like  below.   1 package com.custom;   2    3 import javax.faces.component.UIComponent;   4 import javax.faces.context.FacesContext;   5    6    7 import com.custom.HelpTopic;   8    9 /**  10  * EPM help provider for help topic ids.  11  */  12 public class DefaultELHelpProvider extends HelpProvider {  13     /**  14      * Default constructor.  ...