Posts by Christian Beregula • 1,512 points
68 posts
-
2
votes1
answer58
viewsQ: Parameter that controls camera brightness on android
I imagine it’s some parameter in Camera.getParameters(), but I’m not sure what to look for. I’ll try one by one, but if anyone knows what it is it’ll save me a lot of time.
-
2
votes1
answer94
viewsQ: Auto-update of Publish in Visual Studio zeroing the database
Soon I had to create an installer for desktop application in c#, and as in visual studio 2013 there was Publish that already created Setup and Auto-Update I ended up using it for convenience, but…
-
2
votes1
answer81
viewsA: Binario to Hex
There’s probably a simpler way to do it, but at least I know it works. public void run() { System.out.println("CONECTOU : ID - " + clientID + " - " + clientSocket.getInetAddress().getHostName());…
-
1
votes1
answer1059
viewsA: Minefield, random bombs
I don’t quite understand how your logic works, but the truth is, the problem is how you want to position the bombs. Your matrix when passing the method PreencherMatriz() exits with the following…
c#answered Christian Beregula 1,512 -
0
votes3
answers1689
viewsA: How to make visual form inheritance in Windows Forms?
And if you override this Altera method, where each child implements its own Altera(), I didn’t get to testing but I believe it works. //classe pai public virtual void Altera() {} //classe filho1…
-
1
votes1
answer59
viewsA: Detect absence of light in Android camera
I’ve never heard of such a library, I believe only by performing a direct check on the captured image to find out. And performing this check "manually" is not so difficult if it doesn’t depend on a…
-
2
votes1
answer861
viewsA: How to automatically fill an Edittext on android
Just add a Textchangedlistener in editText quantity and value unitario, something like: quantidade.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence s, int…
androidanswered Christian Beregula 1,512 -
1
votes2
answers3291
viewsA: Obtain the number of decimals of one decimal
If it’s just for different ways I’d like to use a while public static int casasDecimais(decimal d) { int res = 0; while(d != (long)d) { res++; d = d*10; } return res; }…
-
4
votes2
answers129
viewsA: Evolve a basic class in Java
I had actually thought a little differently. I would look something like this: public class Animal { private boolean alive = true; public Animal() { } public Animal(Animal animal) { this.alive =…
javaanswered Christian Beregula 1,512 -
3
votes2
answers658
viewsA: Problem writing data to Postgres
You could use a Dictionary when loading your combobox. Dictionary<string, int> options = new Dictionary<string, int>(); //função que você chama para carregar seu combobox //dentro do…
-
4
votes2
answers238
viewsA: How to create operators in C#?
I don’t know if it would be possible to create a unique symbol for you, but it is possible to give an "override" on a certain normal operator using a class. public class TesteOperador { public float…
-
1
votes4
answers2109
viewsA: "Filter" equal records into a list by adding their quantitative
public static List<Teste> SomarIguais(List<Teste> list) { if(list == null) return null; List<Teste> resultado = new List<Teste>(); foreach(Teste t in…
-
1
votes1
answer469
viewsA: Write to the right line of the file and find parameters present in it?
File.Writealltext method (String, String) Creates a new file, writes the specified string to the file, and then closes the file. If the destination file already exists, it will be overwritten. So to…
c#answered Christian Beregula 1,512 -
2
votes1
answer185
viewsA: Set using matrix in c#
I imagine that solves any size of matrix public static string[] TodosPossiveis(char[,] letras) { int linhas = letras.GetUpperBound(0) + 1; int colunas = letras.GetUpperBound(1) + 1; int max =…
-
0
votes2
answers2457
viewsA: Subtract dates and compare with value
From what I understand from everything you said would be something like this: TimeSpan res = DataAtual - DataAcesso; if ( (byte)res.TotalHours < TempoAtualizacaoAutomatica ) { //on } else { //off…
-
1
votes1
answer183
viewsA: Capture datagrid id
The event would only be useful in your case if you need to update other fields whenever the user makes a change on the selected row, if it is not so just get the id straight from the table should…
c#answered Christian Beregula 1,512 -
1
votes0
answers327
viewsQ: connection via socket server android, client c#, server within another network
I was able to do the communication C# -> Android without problems, but when Android connects to a local network, I do not know how to make this connection via ip, since it acquires the local IP.…
-
1
votes0
answers74
viewsQ: Rotate android image without resizing it?
I am "translating" a program written in c# for Android, and I had a problem during the rotation of an image. The code works normally, but returns an image of size different from the original, I…