Friday, September 19, 2014

Convert a property like file to a HashMap For Java with Regex in Python

I have a huge list of property like file. Now I need to convert this property like file to a HashMap in Java. Let's say my HashMap variable name is myHashMap. Recently I was playing with RegEx and Python. So I thought why not try to combine RegEx with Python to do this job! So, here's my solution.
NB: I've trimmed the property key and value.



To get the detail of the pattern go to RegEx101 and paste the below expression inside regular expression section.











AUTHOR:OBSCURE

Pagination With Oracle In JPA Native Query

Pagination in MySQL or PostgreSQL with limit is very easy. But Oracle doesn't support limit. So, in oracle generating paging query is a real trick.
Finally found a nice solution. With this piece of code generation pagination query is like charm. So have fun with this.














AUTHOR:OBSCURE

Thursday, October 31, 2013

Online avro phonetic typing - বাংলা


Press Ctrl+m to switch between English and avro-phonetic bangla typing.
Hit Space, Enter or Tab to transliterate.


AUTHOR: OBSCURE

Tuesday, October 22, 2013

Transfer big file with scp without blocking console and see progress

Problem statement:
  1. I must move a large file from one host to another, I used scp for it.
  2. But I need to use it without blocking console so that I can exit the terminal, so I should use nohup with scp and &.
  3. But I wanna see progress after some time. 
After searching solution for this I found the screen. To transfer file with scp without blocking console:
  • Step 1:
    execute this line to transfer file to remote host
    • This command will prompt for a password, give remoteHost's password.
  • Step 2:

Monday, October 7, 2013

Export and Import MySQL database from terminal

Below code will export MySQL database to a file and import it to another MySQL database from the file.


















AUTHOR: OBSCURE

Install and configure MySQL database for Cent-OS

Following are the command to install and configure MySQL in Cent-OS.



If the log-in and all other privileges is needed from ip-address other than the localhost following command needed to execute depending on what is needed:





AUTHOR: OBSCURE

Thursday, July 4, 2013

How to find duplicate values, and occurrences count in Oracle Database?

the easiest SQL query which will return the duplicate value and count for a given column is as follows:




















AUTHOR: OBSCURE