Questions tagged as 'java'

1
answer

Error "could not be parsed" when converting string to DateTime type

I get a DataHora String like this:    2017-10-11 10: 39: 04.217923 I remove this number after the period, and I use LocalDateTime.parse() : private final String PATTERN_DATA_HORA = "dd/MM/yyyy HH:mm:ss"; [...] Movimentacao movi...
asked by 11.10.2017 / 17:38
1
answer

orphanRemoval JPA

How does orphanRemoval work? Why when I put it in a list does not work ex: @OneToMany(mappedBy = "simulationMedia", cascade = CascadeType.ALL, orphanRemoval = true) @JsonIgnore private List<SimulationChemicalMedia> simulat...
asked by 05.10.2015 / 22:19
1
answer

How do I put my list in alphabetical order?

I have ListView and would like to put it in alphabetical order by the names of the clients. I urge you to be as specific as possible because I do not have much experience. import static android.R.id.list; import android.app.Activity...
asked by 05.01.2016 / 19:35
1
answer

Is it possible to convert an image to a string in JSON format?

I wonder if it is possible to convert an image to a string in JSON format. If so, could you explain to me how? (if possible with example codes). I need to do this to send those images to a webservice which will be responsible for saving it to th...
asked by 03.08.2017 / 20:07
3
answers

JavaScript to extract accents and special characters does not work the same way in all browsers?

I have the following JavaScript: function validaCaracteres(strToReplace) { strSChar = "áàãâäéèêëíìîïóòõôöúùûüçÁÀÃÂÄÉÈÊËÍÌÎÏÓÒÕÖÔÚÙÛÜÇ"; strNoSChars = "aaaaaeeeeiiiiooooouuuucAAAAAEEEEIIIIOOOOOUUUUC"; var newStr = ""; for (var i = 0; i < str...
asked by 09.09.2015 / 20:16
2
answers

I'm not able to get a listView that uses an ArrayAdapterString

I have a main class that inherits from Activity where I have my views, but I needed to create another class that inherits ArrayAdapter. But I'm not able to present my listView, the strange thing is that when you take an item from the list and pr...
asked by 23.09.2015 / 16:14
2
answers

Get only the first name, after space using Java

Good afternoon. I have the following String:    "Carlos Ferreira da Silva" I wanted to get only the first name and ignore rest after the "space". Using regular expressions, how could I do this?     
asked by 07.03.2017 / 21:45
1
answer

Open disk reader with Java, and without specifying the drive

I wanted a simple and quick way to open the disc player if possible without specifying the drive letter. There are several ways I've seen it.     
asked by 28.03.2015 / 15:56
1
answer

Error StackOverflow

Hello, I would like to know why I get the StackOverflow error in this code, but if I add another condition in the recursive method, that is if (list.contains (numb)) I do not get this error. (This code would be to check how many numbers exist...
asked by 19.04.2015 / 00:52
2
answers

How to invert the values of the main diagonal of a 5x5 matrix?

Example input:    1 3 6 8 7   3 7 8 0 3   2 4 3 6 7   8 9 1 3 5   5 6 7 8 5 Example output:    5 3 6 8 7   3 3 8 9 3   2 4 3 6 7   8 0 1 7 5   5 6 7 8 1 I have so far this: BufferedReader in = new Buff...
asked by 09.04.2015 / 18:30