Posts

IoT enablers

Here are some exciting technologies which will push IoT to masses: IBM teams up with mbed for IoT kit Print your own mbed circuit board with AgIC

Bean validation

Bean validation, validating the properties of a Java bean, is the most oft used pattern in any application. In the past, people have been creating their own frameworks to handle the same. JSR-309/JSR-349 strives to create a standardized way of addressing this issue. Below is an example of simplicity and elegance of this solution. import java.util.Set; import javax.validation.ConstraintViolation; import javax.validation.Validation; import javax.validation.Validator; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import static org.junit.Assert.assertEquals; import org.junit.Test; /** * @author Anand.Tamariya * */ public class TestValidation { @Test public void testForm() { Validator validator = Validation.buildDefaultValidatorFactory() .getValidator(); Car car = new Car(null, "DD-AB-123", 4); Set<ConstraintViolation<Car>> constraintViolations = valid...

Do customers prefer to have their loyalty rewards number looked?

Do customers prefer to have their loyalty rewards number looked up during checkout ? Here's some statistics according to an unlisted survery. What's your experience? 75% Preferred that the site would automatically lookup their Rewards Club # based on their billing address and email provided. 13% Preferred to push a button to look up their Rewards Club # and if a match was found, automatically add their rewards number. 10% Preferred to lookup their own Rewards Club # by manually entering their contact information. 2% Preferred to checkout without looking up their loyalty number.

Selenium: Handling NoSuchElementException

Seleniuim throws NoSuchElementException when it can't find the element on the screen. This blog lists down the scenarios and strategy to handle them. Element is hidden by an overlapping <div> This is the easiest to resolve. In case, there's a lightbox, create an action to close it before clicking on the desired element. Page hasn't loaded With Dojo usage, sometimes the page takes lot of time to load - at times causing "stop script" alerts as well. To remedy this, set a page load timeout. driver.manage().timeouts().pageLoadTimeout(5, TimeUnit.MINUTES); Consume the alert. public void acceptAlertIfPresent() { try { // Check the presence of alert Alert alert = driver.switchTo().alert(); // if present consume the alert alert.accept(); } catch (NoAlertPresentException ex) { // Alert not present ex.printStackTrace(); } } Lot of Ajax processing In an app involving lot of Ajax processing e.g. a GWT app, it's im...

Sikuli - QA automation framework

I recently came across a QA automation framework called Sikuli ( www. sikuli .org/ ) which is based on pattern recognition. This essentially gives one flexibility to create a single test case for an application with responsive web-design. So an application can be tested on a web-browser, desktop version of the app and on an emulator for mobile. Do have a look at it.

Face recognition using OpenCV

Image
I'm evaluating software for face recognition and motion sensing and came across OpenCV. It gives excellent APIs for pattern recognition out-of-the-box - see the green rectangles in the photograph.  

Space saving furniture

Some really interesting furniture designs. http://youtu.be/catll-XwVn0