Archive for the ‘Uncategorized’ Category

Gradle not finding tools.jar

May 17, 2017

Was struggling with building my project using gradle for some time. Whenever i tried to build it, i get an error message “Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_131 contains a valid JDK installation.”. I made it double sure that my standard JVM is pointing to the JDK installation folder, not the JRE folder. Still getting the error, later I found out that gradle is taking the java.home for the build process. For that you can either start the eclipse through command line parameter for java.home.

Or the easy solution i found is, go to the gradle task you want to run, right click, go to gradle configuration, and in the Java Home tab, point to the JDK installation folder. Voila, it will build the project without crying.

Happy Coding guys!

Viewing complete strings while debugging in Eclipse

February 14, 2017

While debugging Java code, Strings in the views “Variables” and “Expressions” show up only till a certain length, after which Eclipse shows “…”. Even after working with eclipse for 10 years it was a new info for me. There is a way to show the complete string.

In the Variables view you can right click on Details pane (the section where the string content is displayed) and select “Max Length…” popup menu. The same length applies to expression inspector popup and few other places. In the max length give 0 and you will see the whole values in the value box.

untitled

Thats it guys, enjoy coding.

Debug JUnit tests with Eclipse during Maven build

January 4, 2017

If any JUnit test cases are configured to execute along Maven build, Eclipse won’t automatically debug them. That means even if you mark breakpoints it won’t stop the execution there. We can enable such debugging with a simple goals parameter :

-DforkMode=never test

untitled

Untitled.png

If you are using Maven3 Eclipse plugin, go to Debug configurations, Add a new Maven Build configuration, and add the above goal in the Goals input box. By default, Maven runs tests in a separate process. When you set forkMode option to never, maven plugin will not fork the test process. Hence, while connected to the build process you can debug it. The executions will be stalled at the breakpoints as well.

Happy Coding Guys.

The Ten Commandments of Egoless Programming

July 11, 2012

The Ten Commandments of Egoless Programming:

  1. Understand and accept that you will make mistakes. The point is to find them early, before they make it into production. Fortunately, except for the few of us developing rocket guidance software at JPL, mistakes are rarely fatal in our industry. We can, and should, learn, laugh, and move on.

  2. You are not your code. Remember that the entire point of a review is to find problems, and problems will be found. Don’t take it personally when one is uncovered.

  3. No matter how much “karate” you know, someone else will always know more. Such an individual can teach you some new moves if you ask. Seek and accept input from others, especially when you think it’s not needed.

  4. Don’t rewrite code without consultation. There’s a fine line between “fixing code” and “rewriting code.” Know the difference, and pursue stylistic changes within the framework of a code review, not as a lone enforcer.

  5. Treat people who know less than you with respect, deference, and patience. Non-technical people who deal with developers on a regular basis almost universally hold the opinion that we are prima donnas at best and crybabies at worst. Don’t reinforce this stereotype with anger and impatience.

  6. The only constant in the world is change. Be open to it and accept it with a smile. Look at each change to your requirements, platform, or tool as a new challenge, rather than some serious inconvenience to be fought.

  7. The only true authority stems from knowledge, not from position. Knowledge engenders authority, and authority engenders respect – so if you want respect in an egoless environment, cultivate knowledge.

  8. Fight for what you believe, but gracefully accept defeat. Understand that sometimes your ideas will be overruled. Even if you are right, don’t take revenge or say “I told you so.” Never make your dearly departed idea a martyr or rallying cry.

  9. Don’t be “the coder in the corner.” Don’t be the person in the dark office emerging only for soda. The coder in the corner is out of sight, out of touch, and out of control. This person has no voice in an open, collaborative environment. Get involved in conversations, and be a participant in your office community.

  10. Critique code instead of people – be kind to the coder, not to the code. As much as possible, make all of your comments positive and oriented to improving the code. Relate comments to local standards, program specs, increased performance, etc.

Courtsey : http://blog.stephenwyattbush.com/2012/04/07/dad-and-the-ten-commandments-of-egoless-programming

Adding Glow Filter to Component

April 26, 2012

I got one requirement where I will draw one custom component and it should glow when we mouse hover it and remove glow when move the mouse out. This is a simple thing, though I am putting this so that you can save time. 🙂

First we need to write a function which will be triggered on both mouse hover and mouse out of the component. Obviously it will accept one MouseEvent. Inside that we need to create one GlowFilter and add this filter to the component. Set the properties for the flow filter such as color, alpha and quality. On mouse out am removing all the filters. This will work for me since I do not have any other filters for the component. If you have other filters, then iterate through the filters and remove only the glow filter. The function will look like below :

private function highLightCircle(event:MouseEvent):void{
            var glowFilter: GlowFilter = new GlowFilter();
            var circ:Object = event.currentTarget;
            if(circ.filters.length == 0){  
                glowFilter.color = 0xFFFFFF;
                glowFilter.alpha = 1;
                glowFilter.blurX = 10;
                glowFilter.blurY = 10;
                glowFilter.quality = BitmapFilterQuality.HIGH;
                circ.filters = [glowFilter];
            }else{
                circ.filters = null;
    }
}

Now we need to call this on mouse over and mouse out. Just add the event listeners to the component object on which you need to apply the filter like below.

circle.addEventListener(MouseEvent.ROLL_OVER, highLightCircle);
circle.addEventListener(MouseEvent.ROLL_OUT, highLightCircle);

Thats all guys. Flex your life. Happy Coding. 🙂

Design Patterns by Examples – Decorator Pattern (via Zeeshan Bilal’s Blog)

August 23, 2011

One of the best articles I had seen so far on decorator pattern

Design Patterns by Examples – Decorator Pattern Introduction This series of articles will help you to build a good understanding of design patterns using different examples from real life and some from well-known frameworks or APIs. There are many articles around the web that discuss design patterns but they sometimes lack appropriate examples to quote. So, either their purpose stays unclear or we cannot memorize the patterns longer and sooner they slip out of mind. More importantly, we unders … Read More

via Zeeshan Bilal’s Blog

2010 in review

January 2, 2011

The stats helper monkeys at WordPress.com mulled over how this blog did in 2010, and here’s a high level summary of its overall blog health:

Healthy blog!

The Blog-Health-o-Meter™ reads This blog is doing awesome!.

Crunchy numbers

Featured image

A helper monkey made this abstract painting, inspired by your stats.

A Boeing 747-400 passenger jet can hold 416 passengers. This blog was viewed about 8,900 times in 2010. That’s about 21 full 747s.

 

In 2010, there were 9 new posts, growing the total archive of this blog to 19 posts.

The busiest day of the year was May 18th with 51 views. The most popular post that day was Flex interview Questions.

Where did they come from?

The top referring sites in 2010 were google.co.in, google.com, en.wordpress.com, search.conduit.com, and mail.yahoo.com.

Some visitors came searching, mostly for flex interview questions, flex interview questions and answers, flex 3 interview questions, ibatis logging, and flex interview question.

Attractions in 2010

These are the posts and pages that got the most views in 2010.

1

Flex interview Questions December 2008

2

Logging in Ibatis March 2009
1 comment

3

Getting Class of an Object in Flex February 2009

4

Redirecting the Eclipse/Flex Builder Console output to a log file August 2010
1 comment

5

Like operator in iBatis December 2008
3 comments

My first techie post

December 5, 2008

Hi All,

I am happy to start a new technopedia blog apart from the existing blog “devilsoldier.wordpress.com”. Am a software engineer with more than 2 years experience in service industry. I am trying to scribble some technical tips and tricks which even I can use as a reference later. Infact I want to put down some of the small small findings I come across in my tec h life. Hope everyone will encourage this.

Thanks,

Anoop


%d bloggers like this: