Thursday, October 5, 2017

How to use Regular Expression in Unix Linux

One of the most powerful tools available to programmers are Regular Expressions, if you are good with regular expressions you can solve many day to day problem extremely quickly e.g. find all the lines with ERROR in the log file , find the count of any particular ID in the log file , find exceptions etc.




Regular Expression Example in UNIX

a regular expression is a generic concept which has implemented in many different languages and many different tools including Java , here is some of the tools and languages which use a regular expression.

The vi editor which comes standard with the Unix/Linux operating system.
  • Any decent programmer's editor e.g. EditPlus
  • The grep command found standard on many operating systems including Unix/Linux.
  • The Perl programming language.
  • The PHP programming language.


regular Even if you feel regular expression is complex and hard to learn I would suggest to familiarize with at least basic set of regex and try to use it as much as possible and later you will only want to learn more and more to do the stuff quickly.


here are some of the basic regex and their examples:


1) you want to find ERROR in a log file in Linux ?
grep ERROR logfile


2) you want to find lines starts with ERROR ?
grep ^ERROR logfile (^ is used to find for starts with)


3) you want to find lines ends with ERROR ?
grep ERROR$ logfile ($ is used to find for ends with)


4) you want to find empty lines in a log file ?
grep ^$ logfile


5) you want to match upper or lower case ERROR ?
grep [Ee]RROR logfile ([] is used to include letters]





6) find all lines that contain Error or Exception ?
egrep ERROR|Exception logfile ( | is used for OR condition)


7) Match the letter E when it appears at least 3 times in a row but possibly 4 or more times in a row: E {3,}


8) Match the letter E when it appears 3 times in a row or 6 times in a row or anything in between. E{3,6}


9)Match E when it appears 1 or more times in a row.
E+


10) (E+ and E{1,} mean exactly the same thing!)



Related UNIX Command Tutorials
  • 10 examples of find command in UNIX (examples)
  • 10 examples of grep command in UNIX (examples)
  • 10 examples of date command in Linux (examples)
  • How to get IP address from hostname and vice-versa in Linux (command)
  • 10 examples of xargs command in Linux (examples)
  • 10 examples of tar command in UNIX (examples)
  • 10 examples of Vim in UNIX (examples)
  • How to create, update and delete soft link in UNIX (command)
  • 5 examples of sort command in Linux (examples)
  • 5 examples of kill command in Linux (examples)
  • 10 examples of chmod command in UNIX (examples)
  • 10 tips to work fast in UNIX? (tips)

Thanks for reading this article so far. If you like this article then please share with your friends and colleagues. If you have any questions or feedback then please drop a note.

Share Your Interview Experience with Javarevisited

Hello Guys,
How are you? Hope you are doing well.
It's been 5 years since I have started Javarevisited. In last five years, I have worked hard to make Javarevisited a good resource to prepare for Java interviews, and to make it even more useful, I am inviting you, my readers, to share your Interview experience with us, the Javarevisited community. If you like Javarevisited and think that it has helped you in past, and you want to give something back to the community, then it's time to share your own interview experience with us.

Monday, September 25, 2017

Finally Eclipse supports JDK7 in Eclipse Indigo 3.7.1

Much awaited release of Eclipse with JDK7 is now over, Eclipse has announced release of version Indigo 3.7.1 which will support JDK7.though I already have downloaded Netbeans with JDK7 support I was eagerly waiting for my favorite java development IDE to comes with java7 support. I am expecting this to support all new java7 features including automatic resource management, string in the switch and multiple-cache block in exception handling. You can download the new Eclipse 3.7.1 version from here. You can also update your existing eclipse IDE with new feature from Menu-->Help-->Check for
Updates.

There is not much in this release except JDK7 feature, no new feature has been introduced which will probably be released in either 3.8 or 4.2. Java community is still embracing JDK7 but sooner or later it will adopt it and my feeling is that it will happen very soon because it contains the similar features which JDK 1.5 was contained though not that significant but still pretty useful for day 2 day work.


Enjoy
eclipse with jdk7, eclipse indigo 3.7.1 with java7





Further Learning
The Eclipse Guided Tour - Part 1 and 2
Java Fundamentals, Part 1 and 2
The Java Developer's Guide to Eclipse


Other Java Eclipse articles you may like to explore
  • 30 Useful Eclipse Shortcuts for Java Developers (list)
  • How to remote debug Java application in Eclipse? (tutorial)
  • 10 Eclipse debugging tips Java developer should know? (see here)
  • How to attach source code for JAR file in Eclipse? (guide)
  • Eclipse shortcut to print System.out.println statements? (shortcut)
  • How to increase console buffer size in Eclipse? (steps)
  • How to use spaces instead of tabs in Eclipse? (guide)
  • How to create an executable JAR file from Eclipse? (example)
  • 3 Books to Learn Eclipse IDE for Java developers (list)
  • How to Increase Heap Size of Java Program running in Eclipse? (guide)

Thanks for reading this article so far. If you like this article then please share with your friends and colleagues. If you have any questions or feedback then please drop a comment.

Saturday, August 12, 2017

How to Check Java Documentation of a Class in Netbeans IDE

Recently I have downloaded Netbeans IDE 7.0 to learn its GUI builder Matisse and I was impressed with the changes I saw in the Netbeans from my last use of it in 2007. I was a hardcore Netbeans fan when I was developing mobile application using J2ME and Netbeans integrated environment with WTK, Profiler, and Network Monitor just rocks and on top of that they had conditional compilation feature based on type of platform you   were working like you could maintain your code easily even if you are using device-specific libraries e.g. Nokia UI library etc. Anyway, those were the things of past, what attracted me is the Javadoc feature of Netbeans. Though this feature might have existed long back I have just started using it. Earlier to see Javadoc I used to Google and then go to Sun (now Oracle) website to view Javadoc of any class. While playing with Netbeans I discovered that you can easily Javadoc in the Netbeans IDE itself no need to visit the web.

Thursday, August 3, 2017

How to revert back to Windows 8.1 from Windows 10 Update?

If you remember, I have updated to Windows 10 yesterday and blog about the problem I was facing with respect to clarity of text and blurriness on Chrome and Firefox browser e.g. text was turned white to some places and it wasn't pleasant working in the browser. There were few other issues, which prompted me to revert back to Windows 8.1 update, which was the version I was running before upgrading to Windows 10.  Though Windows 10 has lots of good feature in terms of improved search, security and start menu, I didn't adjust it well. Since I don't have time to play around different visual settings and other things, I decided to roll back to Windows 8 version.

Wednesday, July 26, 2017

How to bypass Websense Internet Filter at Office, School to Access Programming WebSites

Recently one of my readers emailed me that he can not access any .blogspot or .wordpress domain from his office because Websense is blocking them as personal blogs category. Since we techies, often relied on personal technical experience, tips shared by fellow developers for our work, this feels really annoying, but same time it's difficult to convince Websense guys or local Websense security team to not put such restriction. I was thinking about alternative and done some research on the internet, which tells me that you can bypass Websense filter at school or office by using proxy sites, but this idea doesn’t seem good to me, as they may contain some unwanted piece of crap, which is not good for anyone's computer. Also, if you are working for a decent size company, there is good chance that those proxy sites will also be blocked by Websense. This leaves no option at all to access any technical or programming blog, hosted on a free domain like .blogspot or .wordpress domain. That’s why some blogger prefers to have their own domain name than relying on blogger or WordPress.

Monday, July 17, 2017

Good time to become Java Certified Programmer - 20% discount on ALL Exams

In a nice gesture, Oracle has announced 20% discount on any Java certification to celebrate 20 years of Java. Which means now you can get your Java SE certification at 20% discount, this is almost a saving of almost 50 USD. This is really exciting to all Java developers who are preparing for Java SE 8 certification, 1Z0-808 (Oracle Certified Associate, Java SE 8 Programmer) or certified Java developers who are looking to upgrade their certification for Java SE 8. This discount is available to ANY Java certification, including OCPJP 6, OCAPJP 7, OCPJP 7 and OCAJP 8. Now, the big question, how do you get this discount?  Not much, just choose the exam you want to take and register for it as shown below, but don't get late. This offer is only valid till 31st December 2015.

Thursday, June 8, 2017

Tibco tutorial : Reliability Parameter Explained

Reliability parameter is one of the important stat up parameter we provide to Tibco rvd and incorrect setting up of this parameter can screw up things in a big way. When I wrote Tibco Tutorials for beginners I thought to explain some individual concept on separate tutorials and this article is part of it. Tibco messaging is one of the most used messaging solutions on Investment banks over the years and will continue for coming years.

Sunday, March 19, 2017

10 Famous Laws of Computer Programming and Software Enginnering World

Like any other field, Software and Programming world too has some interesting and famous rules, principles and laws, which programmers, developers, managers and architects use often in conversations, meetings and chats. These laws are either rules, principles, or famous words from great personalities of computer programming world. At the same time these laws are interesting, funny, worth knowing, and few of them are just amazing to read. I have sharing things which is worth knowing and useful for not only Java programmer but also developers from other programming language e.g. we have seen 10 Object oriented design principles, which is not only useful for Java guys but also with any OOPS programmer. In this article, I am going to share my collection of 10 famous software and computer programming laws, I am sure you would have few more to add into this list. Please share a computer programming rules, or a thought of wisdom, which is worth knowing among software professional.

Friday, March 3, 2017

Top 10 Most useful cvs commands in linux/unix

This article is in continuation of my earlier article Top 10 basic networking Commands in Unix  and 10 tips of working fast in unix  to read more see here 10 tips of using find command in linux.


Here is my list of most useful commands in Linux , its important that we know this and use it regularly while working with files folders which is in CVS.

Tuesday, February 14, 2017

TIBCO Ledger file in Certified messaging : TIBCO Tutorial

TIBCO Ledger files in certified messaging
This is in continuation to my previous article on TIBCO Certified messaging, in this TIBCO tutorial we will discuss about what is TIBCO ledger? What is process based ledger and what is file based ledger?  Which messages are stored in TIBCO ledger? What are advantage and disadvantage of using TIBCO ledger? When should we use Process based and File based ledger etc. if you would like to read my earlier TIBCO Tutorial please see.

Tuesday, January 24, 2017

Things to note down while writing your own FIX Engine on FIX protocol

This is in continuation of my FIX protocol tutorial, i am just sharing some of thoughts which are important to remember while writing FIX engine for FIX protocol , though there are couple of professional third party FIX engines are available you may need to write your own if your firm requires.
While writing your own FIX engine I would suggest paying attention to certain points which could save lots of time during maintenance phase

Friday, January 27, 2012

Sudden Drop in Traffic? Could be Google page layout algorithm update and Above the folds ads.

Recently Google made new update called helpful content update which reminded me of page layout algorithm improvement update that targets website, blogs having excessive ads on Above the fold page area. if you are experiencing sudden traffic drop from last few months starting from August , you are most likely affected by Google Helpful Content update which is quite similar to Google page layout algorithm update. This Recent Google search update is causing severe drop more than half of normal traffic to various sites and blogs which has two or three ads around header and above the fold area. here are important points I have read and collected regarding Google page layout algorithm update and how it affecting various sites and blog:


Google page layout algorithm update and Above the folds ads.

1) Google Page layout Algorithm improvement update was done around 19th- 20th January 2012. So if your website traffic is down or reducing from that period and you have ads above the fold you may be affected by this Google update.

Friday, December 16, 2011

Is Apple IPhone4S Siri going to replace the Google Search Engine

I am sure this is one of those most optimistic title you can think of but that is what my first thought after seeing apple introductory video of Siri, there new voice recognition and task completion service integrated on Apple Iphone4s. I was amazed with smoothness and accuracy of Siri as shown on that video. You just say siri what's whether, find me new restaurant, traffic status and you get a response you are looking for, this looks to me a new way of searching web and technology.  Asking questions is more natural than typing on Google and believe if Siri kicks of like that you will suddenly have more search volume via siri than google, though only limiting factor is not everybody has Apple Iphone4s with them :). People are also thinking Siri as Google Killer let's see.

Thursday, October 13, 2011

Dennis Ritchie, Creator of C language and Unix has passed away

I just come to know about this sad news that Dennis Ritchie passed away, It is second blow to technology world after Steve jobs who has recently passed away. Dennis Ritchie is the first programming figure I come to know when I started my programming classes in C and C++ and that's why when I heard this news I feel sad about it and suddenly I remember my programming days and I thought about this post to pay my tribute and remember him.


Dennis Ritchie creator of C and Unix passed away
There is lot of Great information available on Dennis Ritchie in web and Wikipedia but two of its main contribution is:

1) C Programming language, which is still number one after Java.
2) His Contribution in UNIX Operating System which is best Server Operating system available.
3) Author of book


Let’s remember this programming genius and pay 2 minute tribute to him, without his C language and immense contribution to programming language, community will never forget him.

May god rest his soul in piece.