Posts by Caffé • 17,429 points
254 posts
-
10
votes1
answer27404
viewsA: Difference between CAST and CONVERT in Mysql
Considering the examples you quoted, there is no difference beyond the syntax. The two functions are described in the same page in Mysql documentation. The explanation of the documentation for the…
-
3
votes4
answers3475
views -
2
votes3
answers2269
viewsA: What is the most efficient way to select items from a table?
The technique for processing, in the application, a large volume of data obtained from a DBMS is: Fire query (SELECT) asynchronously, Immediately start processing the returned records, Continue…
-
1
votes1
answer262
viewsA: Repository not deleted completely, SVN status gives me exclamation points
To delete a folder or directory from SVN (Subversion) committing immediately delete this, use the command svn delete passing the URL of the folder to the repository instead of passing the local…
-
1
votes1
answer168
viewsA: How to perform a UI jquery effect without losing component positioning?
This behavior is specific to Firefox (tested in version 23) and apparently in previous versions of Internet Explorer (tested in version 11 and works). Chrome 35 also works ok. Reading the comments…
-
6
votes2
answers4192
viewsA: Build and build. What are the differences and when to use?
Difference between Compile and Build In Delphi, Ides treat the Compile as a partial compilation, and build as a full reconstruction of your application or package or dll. Example: You have changed…
-
5
votes1
answer5783
viewsA: Conversion of Dates to Mysql database
You report two problems: one with the date using primeface components (which is innocent in this particular case because this behavior is JSF itself) and one using the class Calendar. Date problem…
-
10
votes1
answer981
viewsA: What is the difference between the Height and Clientheight properties of a Tform?
Height is the very height of the form. It counts for example the titlebar and the top and bottom edges. Clientheight is the height available for child components of the form. For example: if the…
-
2
votes1
answer41
viewsA: Problem with special char insertion via prompt
The character encoding of your table is UTF-8. Your publisher Toad for Mysql must be using this same encoding and therefore the INSERT works as expected. Browse to save the text file containing the…
-
2
votes1
answer803
viewsA: Click event. Display message in current form and open new form
This is because your application is busy opening the form and will only process Windows messages (for example this one that has write new text in the component) when the application is available…
-
2
votes1
answer67
views -
3
votes3
answers2147
viewsA: Detect window resolution change
If you can use Jquery: $(window).resize(function() { // código que será executado quando o browser for redimensionado. }); Behold: Jquery - method . resize…
-
1
votes1
answer193
viewsA: Link does not work after <div> load
The association between the #img-avatar and the Javascript function that displays the menu is lost when the component is recreated (it is recreated in the Ajax request). In order for the function to…
-
9
votes1
answer767
viewsA: Why does PHP allow you to create identifier names with special characters?
Because programmers from other places in the world, like Saudi Arabia, for example, would probably like to be able to create a function like this: نفعلشيئا() There is no reason for the compiler to…
-
4
votes3
answers36844
viewsA: return of decimal places in sqlserver queries
If you are talking about presentation of the result and use MS SQL Server 2012 or higher, you can use the function FORMAT to determine the number of boxes after the comma, thus: select…
sql-serveranswered Caffé 17,429 -
2
votes1
answer4201
viewsA: How to identify in windows event log when a folder is deleted?
Deleted files and folders are recorded in the Windows log on "Security" if the file system audit is enabled. See how apply or modify audit directive settings in a local file or folder. This other…
-
8
votes1
answer2860
viewsA: How to remove URL after upload?
This Javascript command clears the URL by keeping only the domain: window.history.pushState("", "", "/"); It will be logged in the browsing history because this is actually what this command is for…
-
1
votes1
answer228
viewsA: Differentiate product from ingredient
I suggest starting from a well elaborated problem, and designing the model to solve this one problem, implement the software, and from there proceed to the next problem, which may imply a…
-
2
votes1
answer66
viewsA: About page loading Jquery
Your Javascript function is implemented to be executed once the document (the page, so to speak) is loaded. To run the function after an iframe is loaded, use: $(document).ready(function() {…
-
5
votes6
answers10935
views -
5
votes7
answers2227
viewsA: Agile methodologies - a single programmer
In a solo project, the biggest contributions you can get from Agile are the tenth and seventh principle of Manifesto (in the same order): 10º) Simplicity, the art of maximizing the amount of work…
-
2
votes1
answer485
viewsA: How to insert a String variable into an hql?
Use parameters. Example StringBuffer hql = new StringBuffer(); hql.append(" select g.dsCidade from FilialComplementoTO g "); // filtro utilizando parâmetro: hql.append(" where g.sgEstado =…
-
1
votes3
answers1619
viewsA: How to return the last id inserted in the table?
In MS Sql Server, the query to return the last ID generated in the session is: select SCOPE_IDENTITY() as id See the line I added to your code (last line of the block below): $sql = "INSERT INTO…
-
1
votes1
answer985
viewsA: How to return data from a Webservice in XML format?
The code has using for various Assembly namespaces System.Web.dll but lack using for the namespace where the class resides Response, in the case, System.Web. Just add the following line next to the…
-
3
votes2
answers79
viewsA: How to resolve ids problem in jQuery?
Instead of identifying the fields by Id, assign a common class (same name) to both components, and select by class name instead of selecting by Id. For example: $( ".cidade" ).change(function() { //…
-
5
votes2
answers591
viewsA: Nested class in Java
Your code does not work because you are trying to access a non-static member of A (the nested class B) from a static method (static main); and you can only access non-static members of a class from…
-
4
votes2
answers1529
viewsA: Break a For Loop
The command to break or break a loop, in Delphi, is break. Using your code as an example: for x:=1 to 10 do begin if x = 5 then Break; end; x = 5; // nesta linha, x de fato será 5. This command can…
-
5
votes1
answer180
viewsA: Is it wrong to leave a FK inside the table that gives rise to PK?
No, it’s not wrong. If Google and Google Brasil are the same type of entity (both are customers), it is natural that they persist in the same table. If a customer can have a head office or branch…
-
4
votes2
answers1732
views -
1
votes1
answer295
views -
7
votes2
answers2765
viewsA: What is the concept and how to implement an Anemic Domain Model?
What is the Anemic Domain Model? The English "Anemic Domain Model" Anemic Domain Model, is a Pattern design business domain-based software development (Domain), where objects representing business…
-
2
votes2
answers615
viewsA: Split in VBA does not work
There are two problems. Considering the value "José Roberto" in rsSQL.Fields("Name"): 1) In Split(CorpID, , 1), you limit the split to 1, so that ends up returning the full name, "José Roberto". 2)…
-
32
votes2
answers9074
viewsA: What is the difference between mock & stub?
What’s the difference between mock and stub? As a stub only provides ready answers to the calls that will be made during the test, the mock goes further and, in addition to providing the answers,…
-
-1
votes2
answers1483
viewsA: persistence.xml for development and other for production?
The persistence.xml is not a production configuration file. While you can provide all details of access to the database in this file, you should not do so for production use or approval - in these…
-
3
votes1
answer233
viewsA: Select in Entity Framework is not working
Add a line: var idsUsuarios = resultadoConsulta.ToList(); The result will be in idsUsuarios. Or surround your query by parentheses, adding to it a call to ToList: var resultadoConsulta = (from u in…
-
5
votes2
answers3408
viewsA: Create trunk, branch and tag folders in Subversion in an existing repository
Yes, you can. Make a backup of your repository before this operation. Create the folders trunk and branch, move the project from the root folder to the folder trunk using the operation rename. This…
-
11
votes4
answers4816
viewsA: Check Old Play Winner
Since you prefer a few IFs, I made a solution using a IF and a FORonly. Solution: public class JogoVelha { public static String obtemVencedor(String[] tabuleiro) { if ((tabuleiro == null) ||…
-
3
votes1
answer981
viewsA: SQL query does not work when it has accents
Literal text accentuation as a database search filter is a problem, as encoding may differ between the application and DBMS - you would have to ensure synchronization between these settings.…
-
3
votes1
answer228
viewsA: How do I finish my WPF application and boot it again?
Although using WPF, provided you can add a reference to Assembly System.Windows.Form (no reason not to), you can use a namespace method System.Windows.Forms:…
-
1
votes1
answer933
viewsA: Inserting datetime into SQLSRV using PHP
By your error message, you must be getting nothing or an invalid value for Datetime on the line $dataInicio = $_POST['data'];. First of all you need to fix this. Once I can create a DateTime…
-
2
votes4
answers2051
viewsA: Leave last 12 records and delete the rest in PHP/Mysql
Whereas the "last ones" are determined by the date field and the date field is unique, you can exclude everyone who is not among the last 12 dates: delete from visitados where data not in ( select…
-
2
votes4
answers3027
viewsA: Loading the values of a select in my Gridview
The method ExecuteNonQuery is usually used when you want to manipulate the data in the database, for example to perform an UPDATE when you only need to know the number of affected lines. Instead of…
-
0
votes1
answer1168
viewsA: How to create objects from a text file in Java?
See how to read text file in Java: Reading data from Txt with Java Then, for each line, use the method linha.split("#") to obtain an array with the value of each attribute: String atributosPessoa […
-
2
votes1
answer934
viewsA: Disregard the header of a . csv file when importing into the database
This code must be inside a loop that iterates between the lines of the file. Just ignore the first iteration by adding an if below linhaArquivo = arquivo.ReadLine(): bool cabecalhoJaLido = false;…
-
5
votes1
answer81
viewsA: DB oracle Closed Connection
You are closing the connection right after opening it: try (Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@" + conexao + ":1521:xe", "system", "root")){…
-
1
votes1
answer137
viewsA: Is it advisable to write automated tests for the user interface?
Most of your automated testing should* be about your business rule (unit testing). A smaller party should test the integration of these business rules among themselves and with other layers of the…
-
0
votes2
answers1273
viewsA: How to bring in the SELECT result the conditions entered as parameters?
There’s no way to do that. Nor does a resource like this seem necessary because who sent the query is also who will get the results and this subject knows the values that passed as parameter.…
-
10
votes7
answers1478
viewsA: Is using many interfaces a bad programming practice?
In this case it is bad practice because you are writing useless code. Create only the interfaces that are needed now. Leave to create in the future the interfaces that will be needed in the future.…
-
12
votes2
answers198
viewsA: What main precautions should I keep in mind for my application to work properly in different browsers?
Resources that are not in the default definition of HTML, CSS and Javascript are solved differently by each browser; and even the standard features are sometimes solved differently, either by bug or…
-
2
votes3
answers4376
viewsA: What is an N-Tier application?
N-Tier application is an application whose architecture separates concepts physically. "N-Tier" does not refer to logical or conceptual separation only. But in this case if the database server is in…
software-architectureanswered Caffé 17,429