Questions tagged as 'java'

1
answer

Prevent the repetition of an element in a part of the code

I have the following exercise that asks me to define a range and sum all the even values of that range showing which numbers added together, of the sort:    Min = 10   Max = 15       10 + 12 + 14 = 36. However. the output I get is:  ...
asked by 30.10.2017 / 15:09
1
answer

Java Web - remove method Caused by: org.hibernate.MappingException: Unknown entity: java.lang.Integer

Gent, and I'm trying to create a method in which I delete the database record. However, it is giving the following error: Caused by: org.hibernate.MappingException: Unknown entity: java.lang.Integer Code: public void delete(int user)...
asked by 10.12.2017 / 03:35
2
answers

Capturing UTC with an Android application [closed]

Good afternoon everyone! I need to capture, through an android application, the UTC used on the client device to perform internal validations. Thank you in advance!     
asked by 08.12.2017 / 20:52
1
answer

Extract last numbers with Regex

I have these two examples of strings : /news/uk-news/commuter-who-extraordinary-row-woman-12345 /news/weird/dude-who-killed-14-extraordinary-98765.amp I want to get only the last numbers, 12345 and 98765 , respectively. In...
asked by 09.12.2017 / 03:07
1
answer

How to change the width and height of a RelativeLayout by Java code

I want to know how I adjust the width and height values of each relative layout independently of my XML through the respective Java class. I already know how to adjust the width, height and other parameters of the buttons present in my layout th...
asked by 31.10.2017 / 16:40
1
answer

How to use Optional.ofNullable () in this example?

In this example, how can I use this feature to prevent NullPointerException in get ? public Pessoa parse() { Pessoa pessoa = new Pessoa(); RespostaPessoaEncontrada pessoaEncontrada = ObjectMapperFactory.getInstance()...
asked by 01.11.2017 / 12:24
1
answer

Average Hibernate / SQL of a table with multiple relationships

I have the following tables TABLE1 id value table2 TABLE2 id table3 TABLE3 id And with that, I would like to average TABLE 1, with WHERE in the TABLE 3 parameters with Hibernate / persistence, where my tables are obj...
asked by 01.11.2017 / 18:33
1
answer

List 2 Tables in a Oriented Object

I have an academic job. and I'm not listing the DB data, or this is giving the error java.lang.NullPointerException I searched for something similar I found, I saw some examples but the form they use and creating the same attributes within the P...
asked by 22.11.2017 / 12:13
1
answer

Difficulty in generating a JSON object in the correct order

I'm trying to generate a JSON object by following this template: { "schemas": [ "urn:ietf:params:scim:schemas:extension:oracle:2.0:OIG:User", "urn:ietf:params:scim:schemas:core:2.0:User", "urn:ietf:params:scim:sch...
asked by 22.11.2017 / 17:25
1
answer

How to use RxAndroid?

I'm trying to use RxAndroid but I can not figure it out. In reality, I wanted to be able to use methods within an Observable, to access the FirebaseFirestore and retrieve the data into Realm. So the question is: How do I create observable...
asked by 23.11.2017 / 12:18