Posts by Dherik • 10,372 points
299 posts
-
5
votes1
answer264
viewsA: Doubt onkeyup javascript
Javascript-less Try using CSS for this, instead of Javascript, so don’t rewrite the input value: Nome: <input type="text" id="fnome" style="text-transform: uppercase;"> See example here. With…
-
0
votes2
answers6465
viewsA: How to return a list as JSON using Spring MVC (@Restcontroller)?
Altere of: @RequestMapping(value = "/candidatos/", method = RequestMethod.GET) To @RequestMapping(value = "/candidatos/", method = RequestMethod.GET, produces=MediaType.APPLICATION_JSON_VALUE) Then…
-
2
votes2
answers220
viewsA: Declare Set<double> - JAVA
In fact, you can’t use primitive types in Collections java. If you want to work with double and Set, for your case, the alternatives are: Use any library that provides Collections implemented with…
-
2
votes3
answers2089
viewsA: How to implement business rules or system rules using Domain Driven Design in C#?
The rule itself would stay in class Usuario. But you wouldn’t need to validate the password Usuario twice in the domain class, for when you say: Now, a rule that would be: for the user to register…
-
0
votes1
answer80
viewsA: Instantiation error 2 objects with Doctrine entities (Setter)
Try changing the mapping of Estados in class Clientes for: /** * @var \Estados * * @ORM\ManyToOne(targetEntity="\Clientes\Entity\Estados") * @ORM\JoinColumns({ * @ORM\JoinColumn(name="estado",…
-
1
votes1
answer3182
viewsA: Duplicate record - Firebird
There is more than one way to do this. Based on the SQL shown, it is possible to do this: DELETE FROM vendaproduto WHERE pro_codigo IN ( SELECT a.pro_codigo FROM vendaproduto a WHERE a.pro_codigo in…
-
2
votes1
answer231
viewsA: Transforming Query into Linq
I can’t test it, but it must be something like this: from g in db.Gestor join e in db.Entidade on g.UniaoEntidadeId equals e.EntidadeId group g by g.Nome into grpNome where grpNome.Count() > 0…
-
7
votes1
answer7210
viewsA: What is the difference between & and && in SHELL?
The operator & (Ampersand) is used to put the previous command on background and, if there is a later command, it will be executed independent of the result of the previous command: free &…
-
3
votes5
answers860
viewsA: Why is a variable with no value considered uninitiated?
I believe it is only a problem of nomenclature and understanding of the method isset. Of documentation: Determine if a variable is set and is not NULL. If a variable has been unset with unset(), it…
-
12
votes3
answers1828
viewsA: How does version naming work for private or public projects?
A well-known model that many companies adopt is the Gitflow: As you may notice, it covers much of the software development aspects: tags to mark versions, a branch of stable version (master), branch…
-
6
votes3
answers14451
viewsA: Turn the first letter of a string into uppercase?
Tip from ONLY in English, small method to do this: public static string FirstCharToUpper(string input) { if (String.IsNullOrEmpty(input)) throw new ArgumentException("Insira uma palavra diferente de…
-
1
votes2
answers2446
views -
0
votes2
answers4428
viewsA: Table to record history record (Best way)?
I believe you’re looking for something similar to the Hibernate Envers java. For PHP, you can choose to use Propel, that has support to versioning of records. Once enabled on a table, the…
-
1
votes1
answer2713
viewsA: Check the existence of an element with Selenium
Assuming your table ID is idDaSuaTabela, you need wait for the table appear until further: WebDriverWait wait = new WebDriverWait(webDriver, timeoutInSeconds);…
-
4
votes3
answers441
viewsA: Why is it not very common to use do/while?
The do/while ensures that the code block is executed at least once. In the case of while, a condition is tested before the code block is executed. Although they are different, I venture to say that…
-
1
votes2
answers704
viewsA: Sending json files to server
I’m not familiar with PHP, but looking at your code I haven’t been able to identify anything that looks like JSON yet. Let’s go in pieces then. First, you need to create a JSON with screen…
-
2
votes1
answer460
viewsA: Error connecting remote database
See if your mysql database has permission for remote connection of users. This command will guarantee this access from any IP (@'%') for the user a1478344_app to any database (*.*). GRANT ALL…
-
0
votes1
answer73
viewsA: HQL query in C#
To be sure how this query would look, I would need the code of all its entities. But, probably, your HQL consultation would look like this: select distinct ConclusionYear as cy from…
-
29
votes3
answers39504
viewsA: How does the git rebase command work?
By answering your questions. 1 - After rebasing on the master branch, the history will be as follows? Yes 2 - If the answer is yes, what is the purpose of redoing the history when one of the…
-
2
votes1
answer170
viewsA: How do I send variables to another page on Windows Phone 8?
You can use the System.IO.IsolatedStorage (for a Windows Phone Silverlight app) or Windows.Storage.ApplicationData.Current.LocalSettings. (for a Windows Phone app). Both can be used on any page. I…
-
0
votes2
answers50
viewsA: How not to send many records by clicking often on the button
Behold this functional example using jQuery, taken from another question from ONLY in English. HTML: <form class="form-horizontal"> <div class="form-group"> <label for="inputEmail3"…
-
2
votes1
answer111
viewsA: How to make this sql
Imagining that your table is called Estudante, this can be done with some Queries: select e.estudante, a11.conceito_1, a11.conceito_2, a11.etapa, a22.conceito_1, a22.conceito_2, a22.etapa,…
-
3
votes6
answers1655
viewsA: Heritage and Polymorphism
My suggested mapping would be like this. public class Funcionario { private Long id; private String nome; } public class Venda { private Long id; private Funcionario funcionario; //relacionamento…
-
2
votes3
answers342
viewsA: Run multiple animations in sequence in jQuery without polluting the code
Are you looking for Promise ;). And your problem has a well-known name, it’s called Callback Hell…
-
22
votes5
answers7270
viewsA: What is the difference between a "branch" and a "tag"?
To make the difference clear, think of the Git repository as a graph, with each node of this graph being a commit. Tag is a pointer you use to point to any node in this graph. The tag is usually…
-
5
votes2
answers312
viewsA: Where to call Savechanges() when you have multiple repositories?
I believe that the Pattern Unit Of Work will solve your problem. With it, briefly, you create a working unit and add the repositories in it. At the end, you call the Commit() of the work unit. Even…
-
21
votes2
answers484
viewsA: Is there an opposite for `contains`?
You can do: var resultado = lista1.Where(li => !lista2.Contains(li)).ToList();
-
0
votes1
answer1016
viewsA: Populate tables with multiple foreign keys
In Mysql, you can use a feature of it called LOAD DATA INFILE. The LOAD DATA INFILE statement Allows you to read data from a text file and import the file’s data into a database table very fast.…
-
1
votes1
answer2863
viewsA: Java how to do a native query and return to a DTO list
Look for result Transformer. They were made exactly for do what you want and works with HQL and SQL (Native query) https://stackoverflow.com/a/13782489/2387977 If you can’t, for some reason, there’s…
-
3
votes6
answers4502
viewsA: How to use two CSS attributes at the same time?
I believe you wish to do this: <!DOCTYPE html> <html> <body> <h1 style="color:#CC0099; font-family:verdana;">Um dia eu aprendo</h1> <p style="color:red">This is a…
-
1
votes1
answer905
views -
1
votes1
answer299
viewsA: Method that checks if the status is ok
I believe the code below helps you: public static boolean hostAvailabilityCheck() { try (Socket s = new Socket("192.168.120.150", 5672)) { return true; } catch (IOException ex) { /* ignore */ }…
-
2
votes1
answer56
viewsA: What is the function of the Deploy option in Visual Studio?
It is common in a Solution to have several projects. Some of these projects we would not like to be on the application deploy. Example of such a project? One that contains only unit tests. A project…
-
1
votes1
answer41
viewsA: Problem with selection in Mysql
The error is very clear: the table veiculo does not have the column veiculo. Apparently, you wanted to look for t1.placa instead of t1.veiculo. The correct query would be: SELECT t1.*,t2.*FROM…
-
3
votes1
answer2983
viewsA: Compare Working Directory file with remote repository file
Imagining that you’re working on the branch master in remote called origin, would look like this: Update your master branch with the latest Github changes git fetch origin master Diff to see what…
-
-1
votes2
answers226
viewsA: Why does Value in Spring MVC need an asterisk?
I believe it is just a Web MVC convention. In my view, when making a /planilha/ In Web MVC you can infer that there must be something after the last /, therefore the need to specify how the match…
-
1
votes2
answers780
viewsA: Multi-tenant system with the possibility of "customization"
Using the isolated model the DBMS would be with many databases. What would be the possible implications of this? You would have a greater difficulty in maintaining the database, as SQL scripts would…
-
1
votes2
answers377
viewsA: Alternative to Exists()
An alternative is to save the value of the time-consuming query and reuse it later. You can use it for this Table Variable or Temp Table. This way, you make the query only once and reuse the…
sql-serveranswered Dherik 10,372 -
4
votes1
answer275
viewsA: Function for Java
Run the code below and see if it helps you understand :) public class Programa { public static void main(String args[]){ int a = 10; for (int i = 1; i<=2; i++){ for(int j=0; j<=2; j++){…
-
1
votes2
answers2226
viewsA: What better way to insert an array into the database
@Jeangustavoprates, you can perform insertion only after mounting all Inserts with SqlBulkCopy or the way down: string stmt = "INSERT INTO DATABASE.DBO.TABLE (CPF, NOME, APTO) VALUES (@cpf, @nome,…
-
5
votes4
answers5471
viewsA: Count occurrences in a list according to prefixes
words = ['rato', 'roeu', 'rolha', 'rainha', 'rei', 'russia'] pref = ['ro', 'ra', 'r'] contTotal = 0 for p in pref: cont = 0 for w in words: if w.startswith(p): cont+=1 contTotal += cont print p + '…
-
2
votes2
answers290
viewsA: How to solve search problem with accented words
Use the function html_entity_decode() before passing the name to the database query. The call will look like this: $string = html_entity_decode($string, ENT_QUOTES, "utf-8");…
-
1
votes1
answer221
viewsA: Instruction Left Join in LINQ to entites
Entity Framework 3.5 does not have LEFT JOIN for Linq queries. But there is another way to do this, described here: https://stackoverflow.com/a/5920182/2387977 I believe that in your case, the code…
-
1
votes2
answers339
viewsA: Incomplete entity class problem - JPA
You are trying to reference a Cotdetatlhe entity that has probably composite key (Cotdetatlhepk). If you want to relate Cotdetatlhe from Cotdetforn, you need to specify each Cotdetatlhepk column as…
-
0
votes1
answer441
viewsA: Get list of JPA/Hibernate Persisted objects
If you want the ID, you need to open the transaction before the persist. You can get the persist ID this way by using the flush(): manager.getTransation().begin(); manager.persist(p);…
-
3
votes1
answer6769
viewsA: Maximum number of simultaneous database connections
The limit of simultaneous connections may depend on: version of your bank; of the configured limit; of hardware capacity; So, how can I set/check the connection limit with the database? The maximum…
-
1
votes2
answers901
viewsA: Pass more than one parameter to another page
You can use Isolatedstoragesettings to store variables before going to the next screen. To store: IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings;…
-
26
votes4
answers82811
viewsA: What is and what does a full stack web Developer do?
Full stack web Developer is a developer profile that can work not only with a certain type of programming but also reasonably understand a number of other technologies involved in a system:…
terminologyanswered Dherik 10,372 -
3
votes3
answers2878
viewsA: What is the best way to verify the existence of a record in the database via application?
As @Andrew mentioned, I prefer to use it too: select 1 from tabela where coluna=valor Out of curiosity, in SQL Server you may need something like this if you need to create an SQL script that needs…