Posts by Haroldo_OK • 565 points
13 posts
-
1
votes3
answers450
viewsA: Annotate: Returning the cheapest product and supplier name (Django)
If I understand right part of the manual referring to Queries, you could implement the query this way: outros_precos_menores = Quotation.objects.filter( product=OuterRef('product'),…
-
0
votes2
answers62
viewsA: Show answers at random without repeating and post method
All value truly random, by definition, it will be repeated from time to time, especially if the amount of items involved is small. To prevent the items from repeating in the same questionnaire, you…
-
1
votes2
answers2674
viewsA: Generate PDF with Jasper and download without storing it
Change your FileInputStream by a ByteArrayOutputStream; save the byte array generated by it, and then use a ByteArrayInputStream in place of FileInputStream; in this way, the whole process will be…
-
1
votes3
answers92
viewsA: Capture which key Unique was raped
When an error occurs, together with the code representing the type of the same, Postgresql also returns a text containing error message; in the case of Unique constraints, the actual text of the…
postgresqlanswered Haroldo_OK 565 -
0
votes2
answers201
viewsA: Add header and footer in txt file generated via phptxt
Use a fwrite before the while to write the header; during the while you will accumulate any variables you need to total and, at the end, after the end of the while, you can use one more fwrite to…
-
1
votes1
answer498
viewsA: Save Game Data in Html5 and Javascript
One of the possible solutions would be to use the localStorage The library persist-js may also be a good alternative; it automatically uses the localStorage if the browser supports, or cookies if…
-
2
votes1
answer271
viewsA: Very large select box content
Generic answer: If you have a large amount of records, actually the select (or similar) element may not be a suitable solution. Try something that allows the user to perform some type of filtering,…
-
3
votes3
answers3450
viewsA: Preloader while the site loads
One way to do this is to put all the essential JS code in the <header> browser, making it necessarily loaded before even the rest of the page is mounted, and placing all non-essential JS at…
-
1
votes2
answers300
viewsA: How to reload grid without checking if it exists JS Jquery
if you are running from the browser, you can use the global 'window' object to see if a certain global variable exists function recarregarGrid(nome) { window[nome] && window[nome].fnDraw();…
-
3
votes3
answers1100
viewsA: How to run PHP code only once a day?
Simply store in a database table the date of the last search execution. When a user executes the search, you compare that date with the current one; if they are different, you execute the code that…
phpanswered Haroldo_OK 565 -
0
votes1
answer333
viewsA: Domain configuration in Tomcat-jsf applications
This is not a Tomcat-specific issue; it is something in the TCP/IP layer. If your IP is dynamic, you will need some dynamic DNS service.
-
5
votes2
answers347
viewsA: Local Storage - Always replaces last data
I assume it would be enough to load the array before updating it: var ClienteArray = JSON.parse(localStorage.getItem('ClienteArray') || '[]'); $('#btn-save').click(function(){ var cliente =…
-
2
votes2
answers60
viewsA: How to search the bank with three types of user?
You can join the tables at the time of the query: select * from Usuario usu left join Administrador adm on adm.id = usu.id and usu.tipo = 1 left join Aluno alu on alu.id = usu.id and usu.tipo = 2…