Core Java: Programming code snippets frequently used

Here are few things I learnt while coding in java: Increment an occurrence in map for(char current : input.toCharArray()){ count.put(current, count.getOrDefault(current, 0) + 1); } Let’s say you want to decrement the occurrence and when occurrence becomes zero, remove entry.Continue reading… Core Java: Programming code snippets frequently used

Core Java: ConcurrentModificationException while removing items from LinkedHashMap

I came across ConcurrentModificationException while editing LinkedHashMap which internally maintains order of the tuple. Below is my code to edit the map. It looks fine to me and no compilation errors too. But, during runtime I faced ConcurrentModificationException even thoughContinue reading… Core Java: ConcurrentModificationException while removing items from LinkedHashMap

MySQL error – has exceeded the ‘max_questions’ resource in database

I had a similar issue on my WordPress site. It was hosted on a shared host. The host limits the connections per user to 25000 every hour.  I see two possible solutions for this to get fixed. First Solution:- TheContinue reading… MySQL error – has exceeded the ‘max_questions’ resource in database

ORA-01194: file 1 needs more recovery to be consistent

Solution that worked for me. SQL> shutdown immediate ORA-01109: database not open Database dismounted. ORACLE instance shut down. SQL> startup mount ORACLE instance started. Total System Global Area  530288640 bytes Fixed Size                  2131120 bytes Variable Size             310381392 bytes Database Buffers         Continue reading… ORA-01194: file 1 needs more recovery to be consistent

java URL using relative path

I have a URL: URL url=new URL(“http://www.abc.com/aa/bb/cc/file.html”); and a relative path: String relativePath=”../file2.html”; //maybe is “/file3.html” I want to get http://www.abc.com/aa/bb/file2.html using variable url and relativePath How to do it? This is very frequent requirement you see if you are dealing with webservices development. OneContinue reading… java URL using relative path

MySQL error – has exceeded the ‘max_questions’ resource in database

I had a similar issue on my WordPress site. It was hosted on a shared host. The host limits the connections per user to 25000 every hour.  I see two possible solutions for this to get fixed. First Solution:- TheContinue reading… MySQL error – has exceeded the ‘max_questions’ resource in database