Posts by Jéf Bueno • 67,331 points
1,254 posts
-
24
votes4
answers5507
viewsA: Why are NULL values not selected?
Null is not a value. As stated in commenting of @rray, null is no value. Your select is bringing all the fields that are not null and which are different from N. To include nulls in your query you…
-
43
votes6
answers34111
viewsA: What is and what is an abstract class for?
Abstract classes are classes that are basically just one inspi abstract (with the pardon of the pun) of how the classes that inherit should behave. Abstract classes cannot be instantiated, as…
-
20
votes5
answers34006
viewsA: How to return the last record of an array with Javascript or jQuery?
You can do this using pure javascript, this way: var array = [1, 2, 3, 4, 5]; var ultimo = array[array.length - 1]; document.write(ultimo); If you prefer to use jQuery, you can do something like:…
-
5
votes2
answers700
views -
5
votes3
answers3818
viewsA: Update an item from a generic list to a specific item
To locate the item, you need to do: var item = aluno.First(x => x.Id == 1); //Localizando o aluno com id 1 To update you: item.Nome = "Novo nome"; item.Email = "[email protected]"; Like Aluno is a…
-
6
votes2
answers5391
viewsA: How to update an item from a generic list?
To change the data of first student in the list, you should do the following: aluno[0].Nome = "NovoNome"; aluno[0].Email = "[email protected]"; To change other positions, you just need to change the 0…
-
4
votes2
answers213
viewsA: Value priority data ordering using LINQ
var lista = contexto.Entidade.Where(/*Alguma condição*/) .OrderBy(e => e.Status.Id == 2) //Ordenar primeiramente pelo status com id = 2 .ThenBy(e => e.Status.Id) //Depois ordenar…
-
5
votes4
answers1166
viewsA: How to sort the data of a query by predefined values?
Yes, you can specify literally the values you want to appear first in the query: SELECT * FROM usuarios INNER JOIN estados ON estados.id = usuarios.estado_id ORDER BY estados.sigla = 'MG',…
-
42
votes3
answers5198
views -
56
votes3
answers68185
viewsQ: What is the difference between endpoint and API?
I’ve always used endpoint and API as synonyms. Today I discovered that they do not mean the same thing, although they are related. After all, what’s the difference between these two?…
-
10
votes1
answer134
viewsA: Power Panel, WHM and Cpanel, what are their differences?
Cpanel Cpanel is a hosting control panel that allows customers of a particular provider to have full administration of their accounts, through a graphical interface, using the browser. With Cpanel…
-
2
votes1
answer231
viewsA: Compare string[] with string
Well, I still don’t know if I can figure out what you need to do, but I just assumed that you want to compare the value you have in a string with all the values of a array de string. To do this, you…
-
6
votes1
answer1320
views -
4
votes1
answer134
viewsA: Default value for Datetime column
Like you’re wearing it Model first an alternative would be to create a class partial and create a constructor that initializes this field. Ex.: public partial CursoDisciplina { public…
-
1
votes2
answers3180
viewsA: javax.faces.Facesexception, java.lang.Nullpointerexception
In your class testeHibernate.java: public UtilizadorDAO utdao; It is not instantiated (therefore null) and is being used in the method save(): That’s why the mistake: {testHibernate.save}:…
-
16
votes2
answers70082
viewsA: How to concatenate multiple Strings in Python?
You must convert your items into campo[indice] for string before trying to concatenate them. A simple example that would solve the problem (although not recommended), is to use: 'Nome: ' +…
-
3
votes4
answers754
viewsA: String Array Printing in a Single Messagebox
You can use the string.Join() In the example below the variable strDados contains all items from array comma-separated. string[] dados = { "um", "dois", "três" }; string strDados = string.Join(", ",…
-
7
votes3
answers31605
viewsA: Check if the element exists in Arraylist and, if not, add it
For you to check if the item already exists in ArrayList, you can do the following: estados.Contains(e); For your method to return the messages you are using, you must do with what kind of return of…
-
1
votes1
answer854
viewsA: How to download from Delphi via FTP servers with authentication?
You can do it with the component Tidftp. Ex.: IdFTP1.Disconnect(); IdFTP1.Host := 'ftp.seuftp.com'; IdFTP1.Port := 21; IdFTP1.Username := 'usuario'; IdFTP1.Password := 'senha'; IdFTP1.Passive :=…
-
18
votes3
answers15565
viewsA: Which regular expression can I use to remove double spaces in Javascript or PHP?
If you consider breaking lines, tabs, among others as spaces use \s, otherwise you can use ( ) - as in the example. PHP $str = preg_replace('/( )+/', ' ', "stack overflow"); Javascript var str =…
-
0
votes4
answers369
viewsA: Doubt in database query, error in query
If I understand your doubt, you just need to use AND instead of OR on your clavicle where. Ex.: PreparedStatement pstm = conexao.prepareStatement( "SELECT * FROM passagem WHERE " + "origem = ? " +…
-
3
votes1
answer169
viewsQ: Have two versions of Python in OSX, no overwrite
Is there any way to install version 3.x of Python without overwriting the pre-installed (essential) version of OSX? I already know the virtualenv but I would like to avoid it, because I only use…
-
1
votes1
answer1484
viewsQ: Apply filter to Datagrid populated with List without changing the Datasource
It is possible to apply filter to a DataGridView which is "filled" with a List, without altering the DataSource grid? Example: When I have a grid that uses a BindingSource I can apply a filter, like…
-
3
votes1
answer743
viewsQ: How to change a property during a LINQ query?
Is there any way to change in the LINQ query a property of the query itself? Ex.: I’m doing a consultation on a List<Cliente> and I want all customers whose NomeFantasia begin with * have the…
-
1
votes3
answers668
viewsA: Uppercase Method for Metroframework
An alternative is to change the event KeyPress of your TextBox to capitalize all letters. private void textBox_KeyPress(object sender, KeyPressEventArgs e) { if (Char.IsLetter(e.KeyChar)) e.KeyChar…
-
4
votes1
answer64
viewsA: Pulling information from a table to a news page
$contador = mysql_query("SELECT count(id) as total FROM 10cms_noticias_resp WHERE id_noticia = id_noticia") or die(mysql_error()); That first clause WHERE is wrong. The id_noticia will always be…
-
5
votes3
answers99
viewsA: Method to save multiple "Players" to a list
You can do it with ArrayList, as follows: ArrayList<String> players = new ArrayList<String>(); //para adicionar players.add("novo_registro"); //para remover…
-
3
votes3
answers5677
viewsA: How to create input masks in a Textfield?
Really with JFX you only have the option to do in hand or take a lib thereby. Below you have a good starting point to start developing your own component. public abstract class MaskFieldUtil {…
-
4
votes2
answers2708
viewsA: Error "1146 table 'phpmyadmin.pma__tracking doesn’t exist"
pma__tracking is a table of use of phpMyAdmin. You probably deleted it by mistake. To restore this table, it is possible to import this file which has all the tables (which is what the phpMyAdmin…
-
1
votes1
answer582
viewsA: How to remove certificate messages from Webbrowser?
Try to call it that before you open the webbrowser ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback( delegate { return true; } ); Withdrawn of this…
-
16
votes2
answers673
viewsQ: When and in which columns should indexes be used?
Reading an article that has nothing to do with database I came across information that use of indexes can bring great improvements to database performance. I have two questions about that: When…
-
2
votes2
answers232
viewsA: C# error when trying to add an inherited component in Toolbox
According to some answers I saw in Soen the problem may be on itself Visual Studio and there are two things that have to be done to try to solve the problem. Right click on the Toolbox and then…
-
7
votes2
answers8619
viewsA: Pass parameter in View
There is no way to pass parameters to a view in the Mysql. More details can be seen in the official documentation There are some alternative forms to define the where of a view dynamically. Create a…
-
6
votes2
answers901
viewsQ: Extract file . ZIP with accent on name
I’m using the lib System.IO.Compression.ZipFile to unzip files .zip and came across a big problem while trying to extract files that have accents in the name. If I try to extract with encoding…
-
8
votes2
answers742
viewsQ: What’s a destroyer for?
In some languages, classes have methods destructors. In the ones I’ve seen, he’s declared a builder with the sign ~ in front. Something like: public class Foo { public ~Foo() { //Fazer algo } } What…
-
1
votes2
answers443
viewsA: Query an XML file - C#
You can make a select using Linnum, as follows: var query = from element in root.Elements where (string)element.Attribute ("atr") == "search" select element; My example is a very simple query…
-
8
votes3
answers224
viewsQ: Use of using versus full name
I’ve been following many projects open source and I realized that there’s a really big alternation between using using (Imports in VB.NET) and use direct reference to the namespace. Example: void…
-
2
votes2
answers578
viewsA: Radio stream with Phonegap
As the comments in the code themselves say, you need to change that line $scope.radioHost = 'http://192.99.8.192'; to receive the radio link you want. Down below you need to change too:…
-
1
votes1
answer79
viewsQ: Items not being updated
I am creating a (several) combobox at Runtime and trying to manually set a SelectedValue 'standard', but I realized that even manually setting a value that exists inside the combo nothing is…
-
4
votes2
answers622
viewsQ: Component for HTML text formatting
I am looking for a component where the user can type the desired text and do the formatting of the text as well as understand. Something like that from ONLY or the image below. Does anyone know any?…
-
10
votes2
answers732
viewsA: How to leave an invisible Tabpage inside a Tabcontrol?
Making invisible is impossible, but you can have the same effect by removing and adding to TabPage at the TabControl: tbControl.TabPages.Remove(tabPage); tbControl.TabPages.Add(tabPage);…
-
14
votes2
answers288
views -
5
votes2
answers10059
viewsA: Read or write attempt in protected memory
I’m going to record here how I solved this problem, in case anyone comes across the same. This first error was caused by I was using a local x64 database and my Instant client was x86. I was not…
-
2
votes2
answers10059
viewsQ: Read or write attempt in protected memory
I have an application in C# connecting to the database Oracle. For this the application makes use of the Nhibernate (a very old version) and Castle Activerecord. This always worked, however, now…
-
6
votes1
answer166
viewsQ: Add property in relation to N-N
How to add properties (columns) in an N-N relation using EF? For example, I have the class Produto: public class Produto { [Key] public int ProdutoID { get; set; } public string Descricao { get;…
-
8
votes1
answer3472
viewsQ: Unable to connect to remote server - When consuming C#webservice
I have an application developed in C# that consumes a webservice also in C#. In some cases (not always and not everywhere/customers) when consuming the webservice i get the following error: Unable…
-
2
votes1
answer338
viewsA: Create a condition within a Linq
Your question is a little confused, but I think that’s what you need. var tipo = from t in p select new { t.Key == "Azul" ? "ValorSeAzul" : "OutroValor", t.Value, }; return Ok(tipo);…
-
6
votes3
answers1639
viewsA: Date format in an NF-e
This format is the UTC standard (UTC - Universal Coordinated Time), where the date is formed by "AAAA-MM-DDThh:mm:ssTZD". Where: AAAA: Year MM: Month DD: Day hh: Hours mm: Minutes ss: Seconds TZD:…
-
3
votes2
answers188
viewsA: Problems running Java class
The variable clientes was not instantiated. All you have to do is instantiate it (clientes = new Cliente()). public void cadastroCliente() { clientes = new Cliente(); //adicione esta linha aux++;…
-
16
votes3
answers7424
viewsQ: What are the main differences between VB.NET and C#?
In addition to syntax, what are the main differences between these two languages? Is there any difference in performance between them? Or is there any case where it is extremely advisable to use one…