Home » Author Archives: Rakesh Cusat

Author Archives: Rakesh Cusat

Code4ReferenceList Recently Used(LRU) implementation using LinkedHashMap

java-logo

Recently I stumbled on one of the Java interview questions: “Implement List-Recently-Used (LRU) Cache using Java collection class?” If you have worked on a similar problem before, then it is really easy for you. Otherwise you start thinking about the best collection class to implement LRU cache. Most of the people fail to recognize that LinkedHashMap provides the support and ...

Read More »

MySQL error: Can’t connect to MySQL server

mysql-logo

You may have stumbled on this MySQL error. If you have already seen this before, then it’s really easy to recognize this and fix it. But if you haven’t seen this error before, then it takes a little longer to troubleshoot the issue. I am listing down the steps to troubleshoot this issue.               ...

Read More »

Apache Server and JMeter debugging

apache-jmeter-logo

I had been using JMeter to generate load for my production server to test my application. The test-plan has 13+ HTTP sampler to make different request and one Regular Expression extractor to extract some value from the response. This value was used in consecutive HTTP Sampler. This test case simple and straight forward. Initially I used 200 JMeter threads to ...

Read More »

JMeter custom function implementation

apache-jmeter-logo

JMeter provides functions that can be used in the sampler. While writing complex test-plan you feel that JMeter is lacking some of the methods. You use Beanshell script to define your own custom method. JMeter invokes Beanshell interpreter to run script the script. This works fine as long as you don’t generate high load (high number of threads). But once ...

Read More »

Debugging SQL query in MySQL

mysql-logo

Recently I started writing SQL query for analyzing and debugging the production code. But I was surprised to see that some queries takes longer time to execute to achieve the same output. I did research and found some interesting stuff about how to debug the SQL query. I have a very simple table who’s definition is as following. In test ...

Read More »

Android: Copy-paste with Intent and support for HTML

android-logo

Android provides support for copy and paste feature using ClipBoardManager. The developer.android.com provides a brief description along with an image which helps to understand the Copy-paste framework. “To copy data, an application puts a ClipData object on the ClipboardManager global clipboard. The ClipData contains one or more ClipData.Item objects and one ClipDescription object. To paste data, an application gets the ...

Read More »

Android AlarmManager tutorial

android-logo

While writing an application, need arises to schedule execution of code in future. You may require AlarmManager to schedule your work at a specified time. AlarmManager accesses to system alarm and schedules the execution of code even when the application is not running. Project Information: Meta-information about the project. Platform Version : Android API Level 10. IDE : Eclipse Helios ...

Read More »

Android dynamic and XML layout

android-logo

Android activity contains various user interface components e.g Button, Radio button, List, Text field etc. The user interface component can be arranged/attached with the activity in two different ways. Declaring UI element in layoutfile Basically, Layout file is xml formatted file present in res/layout. In this file, tags are used to define any UI component and properties are used to ...

Read More »

Android Homescreen Widget with AlarmManager

android-logo

In this tutorial we will learn to create widget with update interval less than 30 mins using AlarmManager. New update: In Android 4.1, a new feature has been introduced for Homescreen widget which enables widget to reorganize its view when resized . To support this feature a new method onAppWidgetOptionsChanged() has been introduced in AppWidgetProvider class. This method gets called ...

Read More »

Android broadcast receiver: Registering/unregistering during runtime

android-logo

In the previous post, we leaned to enable and disable the Broadcast receiver added in the Android manifest file. In this post, we will learn to register and unregister broadcast receiver programmatically. It’s always suggested to register and unregister broadcast receiver programmatically as it saves system resources. In this tutorial, we will make an application having two buttons to register ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.