Skip to content
Advertisement

Android Custom Camera – Crop image inside Rectangle

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

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

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

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

Advertisement