I have a custom camera app which have a centered rectangle view, as you can see below: When I take a picture I want to ignore everything outside the rectangle. The view hasn’t any connection with the Camera Preview or SurfaceView in my XML view, as follows: Can somebody help me how to crop the image properly? I tried to
Spark SASL not working on the emr with yarn
So first, I want to say the only thing I have seen address this issue is here: Spark 1.6.1 SASL. However, when adding the configuration for the spark and yarn authentication, it is still not working. …
how to use NOT LIKE in HQL?
I have a entity as below I want to query all row where logInId does not start with “5” I tried below code: the above code didn’t work. what is the right way to use NOT LIKE in HQL Answer In your query there’s an error: become: e.logInId is string, so you must quote your condition 5%.
spring-ldap auto fetch operational fields
Gooday, Were working on a tool that lets users change there password (generated). And I’m walking in to a litle problem where using Spring Ldap (2.1.0.RELEASE). Now we want to set some of the operational attributes. This is the code I use: Now as long the operational attribute pwdReset is never set this bit of code works fine. But if
convert java arraylist to array using for loop
I have viewed the many similar topics here, none have allowed me to resolve: The many examples I have seen all create an array list by adding in the code, I already have the arrayList. I just need to modify it as an array string and not an arrayList so that I may properly format it as a JSON string
Servlet get GET and POST’s parameters at the doPost method
My problem is when I’m trying to access a POST Variable with request.getParameter(“name”), it works perfectly. But in some conditions, when a POST request arrives at my application, I also need to get GET Parameter from the Query String. As far as I can see, with getParameter, you can only access current request’s parameters, but, as in my condition, as
Finding the number of distinct pairs of integers that sum up to an integer
I am trying to count the numbers of pairs in an array such that each pair gives the sum of an integer! I used the following code : public static int SumPairs(Integer []input, int k){ Map<…
Gson dateformat to serialize/deserialize unix-timestamps
I am using Gson to serialize/deserialize my pojos and currently looking for a clean way to tell Gson to parse/output date attributes as unix-timestamps. Here’s my attempt: Comming from PHP where “U” is the dateformat used to serialize/deserialize date as unix-timestamps, when running my attempt code, I am a RuntimeException: Unknown pattern character ‘U’ I am assuming that Gson uses
jsonObject as string – searching for regular expression to remove password field
I have a json String which will have somewhere in its content a string like this: This can be anywhere in the json string, so don’t assume it’s on the first level. it can even be in a jsonArray. So I need to search the entire string and remove this field, or put its value as null. So I need
Rounding to 0.05 taxes what am I doing wrong?
I’m super stuck on this problem and I don’t know where the math is going wrong. here goes.. Calculate the tax on these 2 products. tax should be rounded to the nearest 0.05. product_ONE price = $47.50 with a tax of 15%—answer should be $54.65; 47.50 * 15 / 100 = 7.125 7.125 / 0.05 = 142.5 -> rounded you