I am trying to find image in an image. I do this for desktop automation. At this moment, I’m trying to be fast, not precise. As such, I have decided to match similar image solely based on the same average color. If I pick several icons on my desktop, for example: And I will search for the last one (I…
Tag: java
Change remote repository credentials (authentication) on Intellij IDEA 14
I recently changed my Bitbucket password for security reasons. However, IntelliJ didn’t update my repository to the new credentials, so it stops me from pulling/pushing anything to my repository. I am not using any plugins for this, just the integrated VCS operations inside the IDE. Every time I pull/pu…
PNGj: Row writing order
The purpose is to draw a small image inside another image at some specified area. Is there any possibility to change only specified rows and avoid rewriting of entire lines of the origin image? I …
Java apache POI java.lang.IllegalArgumentException: Position 21504 past the end of the file
I don’t know what am I doing wrong. I’m just reading and writing an Excel file, but always get this exception: java.lang.IllegalArgumentException: Position 21504 past the end of the file book.xls exists and has the number “1” in each cell from A1 to L50. Answer You are attempting to wr…
Best way to store locators
I’m following page object design pattern for Selenium automation and I can guess that many people store locators in .properties file and access them in code. It seems great to keep locators at separate place. Since, I haven’t work on any big project for Selenium automation, I would like to know th…
Mapping one DB column to two seperate fields using JPA
I’m developing a code generator that have to generate JPA entities from database meta-model files. These model are from home-brewed modeling system which are being used to generate models other than JPA entities. In these models some fields are mapping back to same database column. But it seems like JPA…
Replacing if else statement with pattern
I have a if else statement which might grow in the near future. Since, this is already looking messy, I think it would be better if I can apply any design patterns here. I looked into Strategy pattern but I am not sure if that will reduce if else condition here. Any suggestions? Answer This is a classic Repla…
future.cancel does not work
I have a nice and compact code, which does not work as I expected. The output is : Timeout true END Question: Why does not terminate the future.cancel(true) method the called Runnable? After the program wrote the “END” to the output, the “r” Runnable is still running. Answer The proble…
Spring Boot – Error creating bean with name ‘dataSource’ defined in class path resource
I have Spring Boot web application. It’s centered around RESTful approach. All configuration seems in place but for some reason MainController fails to handle request. It results in 404 error. How to fix it? Application ParserController UPDATE Seems like MySQL cannot be initialized by Spring…. UPD…
Comparing multiple integers in IF statement, Java
I am brand new to coding. I’m currently using “Java:How to program” by Deitel, and one of the early exercises has me stumped. It is asking me to use simple, chapter 1 if statements to compare 5 integers (input by the user) and display both the largest and the smallest. I am limited to the la…