Posts by Marco Giovanni • 2,768 points
73 posts
-
-1
votes3
answers418
viewsA: C# - No argument provided that corresponds to the required formal parameter in abstract class code
In class Funcionario, you have the virtual method, that is, it can be overwritten by classes that inherit it.. In the classes FuncionarioHorista and FuncionarioHorista you want to override base…
-
0
votes2
answers521
viewsA: Remove Auto Indentation from Visual Studio
Go to Tools or Tools, depending on the language of your VS, options/options, will open the configuration window, navigate in it: Text Editor -> C# -> Formatting -> General , and deselect…
visual-studioanswered Marco Giovanni 2,768 -
1
votes1
answer161
viewsA: Spinner Android Retrofit
You can override the method ToString() of your class Identificacao, and and create a adapter of the kind List<Identificacao> instead of the kind List<String>, but this does not leave the…
-
1
votes1
answer401
viewsA: Log in Separate Files [Log4net]
Define the loglevel within appender for filter. More details can be found here <filter type="log4net.Filter.LevelRangeFilter"> <levelMin value="DEBUG"/> <levelMax value="DEBUG" />…
-
0
votes1
answer515
viewsQ: Intellij does not open APK after installation
In my application, after installing , Intellij does not "command" open the apk. My manifest already configured the main activity <application ... <activity android:name=".Activitys.Main"…
-
7
votes4
answers10576
viewsA: To create a folder named after the current date in Windows cmd.exe
You can’t add / in the name of the folder. You should use a mask to date... Is usually used YYYYMMDD that is to say ANO MES e DIA, to make it easy to sort files by date... Here’s an example of how…
-
1
votes2
answers6147
viewsQ: Concatenate columns into a single Postgresql row
I have a situation that would make it much easier. if I could return the data from a specific column in a single row: For example: Table A: Codigo | Descricao ------------------- 1 | Descricao 1 2 |…
-
2
votes2
answers1238
viewsA: Create key in windows registry without permission in c#
You have to open the key in the mode "writable", for this just change key = localRaiz.OpenSubKey(path); for key = localRaiz.OpenSubKey(path, true); Reference: Registrykey.Opensubkey method…
-
1
votes2
answers783
viewsA: What better way to align columns of Datagridview C#
Use this extension in your code, it sets the datagridview, and leaves the columns "free" if the user wants to resize, and already formats the columns that are decimal. public static class Extensions…
c#answered Marco Giovanni 2,768 -
3
votes2
answers1598
viewsA: How do Postgres create a file to populate a bank?
To generate the commands insert of the data contained in the database you can do as follows: Select the Plain format In the Dump Options 1 tab, mark "Date" In the Dump Options 2 tab, mark "User…
-
0
votes1
answer1226
viewsA: Excess redirection ASP NET MVC
After reading this one so-en issue, changed the return RedirectToAction("sign-in","user"); for return Redirect("~/user/sign-in"); and it worked.…
-
0
votes1
answer1226
viewsQ: Excess redirection ASP NET MVC
I have a problem in the project, when accessing the default route, returns me the following error. Esta página não está funcionando Redirecionamento em excesso por localhost Tente limpar os cookies.…
-
6
votes3
answers504
viewsQ: Map Many to Many in the Entity Framework
I’m having a problem mapping with the Entity Framework. I have two models, "project" and "company", where in the "company" there can be several "projects". public class Projeto { [Key] public int Id…
-
1
votes0
answers159
viewsQ: Socket between C++ and C#
I’m facing a problem. I have the server code done in C++, running in Ubuntu. And I have the client code done in C#, running in windows. In the server code (C++) I came across a problem //recebe…
-
3
votes1
answer1495
viewsA: When opening Solution, folders with projects do not appear
Already tried to go on show all files on Solution option? (The icon is highlighted in red) And after that just select the project folders and right-click and select "Include in Project"…
-
8
votes1
answer324
viewsQ: Get all classes that implement a generic interface
I have an interface similar to this: public interface InterfaceA<T> { T Exemplo(); } And other classes implement it. public class ExemploA : InterfaceA<Int32> { Int32 Exemplo(); } public…
-
3
votes2
answers227
viewsA: Changing opacity of one form through another
Pass to tela principal as a parameter for the form fechar, in the builder call. Something similar to this: public partial class fechar : Form { private Form mFormParent = null; public fechar(Form…
-
2
votes2
answers974
viewsA: How to make a datagridview C# sort a list (Ilist) by clicking on the grid header?
If you create a dataTable you don’t have to "worry" about it This function converts your list to the datatable, you need to install this package via nuget, Fastmember, because use the TypeAccessor.…
-
4
votes1
answer82
viewsA: Composite Component in C# does not show all attributes
You must create a "link" between your property datagridview and its component. Something like this: In your component just create a property with get, and set pointing to the property of the…
-
3
votes1
answer575
viewsA: Problem when doing Table Insert in Postgresql
Change the encondig for latin1 with the command below: update pg_database set encoding = pg_char_to_encoding('LATIN1') where datname = 'nomedoBanco';…
-
6
votes2
answers1960
viewsA: Empty delegate ( delegate { } )
Just to complement the @Maniero response, where it’s used... I particularly use to start events not to worry if the event is null For example: public class Teste{ public event EventHandler…
-
2
votes2
answers53
viewsA: Error using values string
It turns out that R.string.avaliacoesesp is a Resource. Do so: numeroAvaliacoes.setText(" " + object.getInt("avaliacoes") + getResources().getString(R.string.avaliacoesesp));…
-
8
votes1
answer290
viewsQ: Progressidialog in C#
I’m trying to create a form similar to Progressdialog on android, in C#.. The idea would be that this would happen: //criar o controle na thread principal frmWaitingProgress fl = new…
-
2
votes1
answer1254
viewsA: Change Listview color when selecting
You must create a selector for the listview item: In the folder drawable create a new "drawable Resource file", for example, let’s call exemplo.xml <?xml version="1.0" encoding="utf-8"?>…
-
4
votes1
answer799
viewsQ: Console in windows Forms application
I have a class where opens the console, shows some data and then closes, when running a second time (without closing the program), an exception occurs in Console.WriteLine("") If executed once,…
-
2
votes1
answer236
viewsQ: Is using the oid column in Postgresql as the primary key correct?
Postgresql creates by default the Oids column (object identifiers), you can get it by doing. select oid, * from table Problem that I have a table that has no primary key, and I want to map it in…
-
3
votes1
answer69
viewsA: Share my result
Just give the toString() in the variable message, for example Esporte objeto = ... recuperar as informações... String message = objeto.ToString();…
-
4
votes2
answers4044
viewsA: Share button
To share any item just call the Intent.ACTION_SEND, for example: Intent sendIntent = new Intent(); sendIntent.setAction(Intent.ACTION_SEND); String texto = "Olá sou um texto compartilhado"…
-
0
votes3
answers703
viewsA: Change native font size
You can set the font size beyond the property android:textAppearance, using this, android:textSize Example: <TextView android:layout_width="wrap_content" android:layout_height="wrap_content"…
androidanswered Marco Giovanni 2,768 -
6
votes2
answers3265
viewsA: How to go through Enum in Java
To get all the values that exist on Enum, do the following: List<TipoPokemon> list = Arrays.asList(TipoPokemon.values()); ou List<TipoPokemon> list = new…
-
3
votes1
answer78
viewsA: Convert a Session to Boolean - Asp.net mvc?
Try this way: @{ bool administrador = Session["Administrador"].ToString() == "S"; } or @{ bool administrador = Session["Administrador"].Equals("S"); }…
-
8
votes1
answer427
viewsA: Error in string to integer conversion
Happens the number you are trying to convert is too large to be int, convert to long... See the following table: tamanho mínimo máximo signed 8 bit -128 +127 signed 16 bit -32 768 +32 767 signed 32…
-
1
votes1
answer212
viewsA: WCF and Summer Time
Try using the following method: public static DateTime FromUnixTimeMilliseconds(Int64 value) { DateTime dt = new DateTime((value * 10000) + 621355968000000000, DateTimeKind.Utc); return…
-
2
votes2
answers690
viewsA: Change property of multiple Uttons simultaneously
You can create a class that you inherit from button, and implement another interface, and then just give foreach us this.Controls.. something like that: public interface iDentes{} public class…
-
3
votes1
answer821
viewsA: How to modify an object attribute in an Arraylist?
What @Denercarvalho said is absolutely correct, I’m just going to post here because I want to mention another observation: listaDeObjetos.get(indice).setAtributoQualquer("Valor Novo"); Like…
-
11
votes5
answers497
viewsA: Print string in reverse
The error is in the statement of i int i = frase.Length Problem frase.Length returns the amount of items within the array. frase[i], starts at the index 0. For example 5 items: frase.Length == 5…
-
4
votes2
answers172
viewsA: serialize class item in textual documents
You can generate an xml, binary or json file.. To save in text, xml mode.. Mark the class Product with the attribute Serializable [Serializable] public class Product { //propriedades.. //métodos...…
c#answered Marco Giovanni 2,768 -
1
votes1
answer79
viewsA: calling Enum for value
Try to cast a cast For example: var variavel = 2; var valorEnum = (EnumTipoBoleto)variavel;
-
4
votes1
answer306
viewsQ: Adjust Alertdialog with Open Keyboard
I have the following problem I have a Alertdialog When the keyboard is opened, the dialog goes up, but part of the dialog is hidden.. it does not adjust the height as per keyboard XML dialog:…
-
6
votes2
answers291
viewsA: Can I use class and struct at the same time?
You can only class in this case as the data manipulation you will be manipulating only the memory address: Difference between class and struct: Class public class Endereco { public string Rua { get;…
-
4
votes1
answer310
viewsA: Is there a way to call a C function in C#?
First you have to export the function in your C. For example //Exemplo.dll extern "C" __declspec(dllexport) double funcaoExemplo (int valor) { //código } and in your C# you should use the Dllimport…
-
3
votes1
answer322
viewsA: Take current Activity and put on another Activity
I suggest passing a parameter to Activity of customers, to know what particular action, for example... Call for details: Intent intent = new Intent(activity, ActivityClientes.class); Bundle bundle =…
androidanswered Marco Giovanni 2,768 -
2
votes1
answer273
viewsQ: Separate Item clickable in android Layout
I have a Listview, and a layout of the Adapter item that follows its basic image Problem is that when I click on any area of the item, in the list, every component is "selected" I would like to get…
-
7
votes1
answer747
viewsA: Silent installation of Postgres and creation of the installer base
If you call the postgresql executable passing as parameter --help will open the information: You must enter the password, the installation path, this you can set through the parameters. So you can…
-
2
votes1
answer150
viewsA: C# Combobox and SQL
There is an example in the documentation on the Sqldatareader.. .... SqlDataReader DR = cmdd.ExecuteReader(); if (DR.HasRows) { while (DR.Read()) { comboBox1.Items.Add(DR.GetString(0)); } } else {…
-
8
votes2
answers1439
viewsA: What is the meaning of this line in Java?
The operator != means different, or compares if the i is different from this.ultimo. Example: //i = 5 //j = 4 boolean exemplo = (i == j) //false boolean exemplo = (j != i) //true the operator ? is a…
javaanswered Marco Giovanni 2,768 -
4
votes1
answer4041
viewsA: Block and unlock editing an Edittext
To block and unlock edittext editing use the property setEnabledof the component, for example : editText.setEnabled(true); editText.setEnabled(false);
-
5
votes3
answers506
viewsA: How to get the object focused on Android
You can get the element by obtaining the view id, through the method getId() , for example public void onFocusChange(View v, boolean hasFocus) { switch (v.getId()) { case R.id.editText1: //caso for…
-
3
votes1
answer1102
viewsA: Android - How to enable and disable wifi
You can use the class WifiManager and through the method setWifiEnabled can enable and disable wifi, official documentation can be found here. To do this you must add the permission in the manifest…
-
0
votes1
answer647
viewsQ: Load HTML into Div via Ajax
I would like to take the answer from ajax, and press div... If I load the div, passing the url works 100% var detalhamentoDiv = $("#detalhamentoDiv");…