Posts by Júlio Neto • 1,228 points
70 posts
-
-1
votes1
answer78
viewsA: Menu with PHP and Mysql
On line 18 of your code, you are typing "ul" before you know if there are any sub-categories. This is a logic problem. This is common because you are not separating business logic from…
-
0
votes3
answers572
viewsA: How to map an entity with a composite key using JPA?
For me, usuario_cargo is a JOIN TABLE, should not become an entity, you can map directly in user or position, in the example, as if it were user: @ManyToMany @JoinTable( name = "USUARIO_CARGO",…
-
0
votes1
answer39
viewsA: Error in PDO embedded
Your query is misspelled: $stmt = $this->pdo->prepare("INSERT INTO [dbo].Usuarios VALUES('$nome','$email','$senha','$cluster','$situacoes_id','$niveis_acesso_id',…
-
0
votes2
answers77
viewsA: how to pass data in json format to a select?
It’s not working because you’re adding the options to a div, not a select. Try making your html like this: <div id="divSelect"><select id="idSelect"></select></div> And…
-
1
votes1
answer1281
viewsA: Format date in Angular?
You can use the Datepipe to format dates, in your example it can look like this: [(ngModel)]="user.dataNascimento | date:'dd/MM/yyyy'" Of course this is an example, the date format is up to you.…
-
-1
votes3
answers72
viewsA: mysql repeated names by select
In fact it will repeat regardless of how many books each author has, since you have not made the Join of the two tables. After doing Join, use the word "distinct" after select, it is the simplest…
-
2
votes1
answer394
viewsA: Error using . stream(). filter in JAVA
All Stream methods return another Stream. To turn back into a list, you need to use a Collector: <Seu stream>.collect(Collectors.toList());
-
0
votes1
answer30
viewsA: Format table column by id using jQuery
If you are sure that the id’s are unique, you can do so: $("#"+id_check).css("color", "red");
-
1
votes2
answers264
viewsA: convert minutes to : hours and minutes
You are doing a decimal division and PHP is returning correctly. What you should do is use the hours only the whole part and do the rest operation to catch the minutes: $horas = (int) $minutos / 60;…
-
5
votes2
answers122
viewsA: How to create regular expression to search for numbers in parentheses?
You need to escape the parentheses with a bar for the regex not to consider it part of the expression, and the expression "[0-9]" can be exchanged for " d": ^(\d+\)\s)…
regexanswered Júlio Neto 1,228 -
1
votes1
answer44
viewsA: Open modal and close the other
From what I understood from your code, if you declare the variable "modal" outside your function, you can close without problem. var modal; function modal(modalID){ if(modal) {…
javascriptanswered Júlio Neto 1,228 -
-1
votes2
answers100
viewsA: How to show the date/time in a modal window?
Just to show a message in a modal dialogue is like this: MessageBox.Show(mensagem);
-
0
votes1
answer53
viewsA: Function to display last seen (current date)- Jquery
The "getMonth()" function of the Date object returns the month number starting with zero, so Jan=0, Feb=1, Mar=2 until Dec=11. You just need to take this into account that otherwise there is nothing…
-
0
votes1
answer45
viewsA: right alignment(right), with the Divs one below the other!
There are several ways to solve this. For me the simplest is the one I will post below. I basically took the float from the internal div and moved to the div "boxqtab" and limited the size of this…
alignmentanswered Júlio Neto 1,228 -
1
votes2
answers529
viewsA: Avoid double quotes in CSV file exported with PHP
Has two solutions, one is to pass an empty string in the fourth argument of the fputcsv function: fputcsv($output, $row, ";", ""); Or rewrite the line that writes the data to the file, using the…
-
0
votes1
answer38
viewsA: I need to return an empty td if there is data in the database
As you make 3 different queries, you also have different amount of results, and as each cell of your table is a result, you end up with each row of your table with different number of cells. The…
phpanswered Júlio Neto 1,228 -
0
votes1
answer33
viewsA: Retrieve specific field of a primary key via get()
If the primary key is composed, you need to pass both to get the entity via get: $aditivo = $this->Aditivos->get([$id, $idcontrato]);
-
-1
votes1
answer503
viewsA: Run stored Procedure in oracle database in PHP
No need to quote on the name of the project: $sql = 'EXECUTE PORTAL_importaXml (?,?,?)';
-
3
votes2
answers392
viewsA: SQL Server - CONCAT + IF in VIEW
You can use "CASE WHEN" to solve your problem in the first query, works as an IF: SELECT CONCAT('Total de ', COUNT(E.ID_GRUPOECONOMICO), ' cliente(s) ' + CASE WHEN GP.GRPECON_DESCRICAO IS NULL THEN…
-
-2
votes3
answers681
viewsA: Extract date with Regex
Your regex will only work if the date is at the beginning of the string, try to get the " " out of the front.
-
0
votes2
answers667
viewsA: Know all the $_SESSION
As William said above, if you just want to see, the print_r or var_dump will follow. If you want to use in your application, just keep in mind that for all purposes the $_SESSION variable can be…
-
1
votes2
answers444
viewsA: MVC + DAO - Which way should I choose in PHP?
First question: in Java, in the Model class I can create in the Class the attribute Sector s, but PHP is not typed, as I could solve this association case? You create the attribute the same way:…
-
1
votes1
answer240
viewsA: Access attributes of type Object
If items are always Subjects, why don’t you declare as Subject and not as Object? Anyway, if you don’t want/can change this, to access the Subject attributes, you need to cast, so java will try to…
-
0
votes1
answer46
viewsA: Location of the Photo in Xamarin Multiplatform
Access to the file system is platform dependent, so there is no way to directly access the Xamarin cross-platform API. Usually this is solved via dependency injection, you create an interface, and…
-
0
votes1
answer206
viewsA: Header and Footer with ASP. Net C#
In ASP. Net you do not include pages, as is done in PHP, you have to create a Layout page, which is a complete page, both with Helder and footer, and your page will be a fragment within this Layout…
-
0
votes2
answers1155
viewsA: Pick up input values
From what I understand, you want to take these inputs in PHP, for this you can use the $_POST variable to get input values from the name. Sort of like this: $input1 = $_POST["name_do_input"];…
-
1
votes1
answer394
viewsA: Progress Bar - How to take decimal values?
You can set the value of the Maximum property of Progressbar to a higher value and multiply. For example you set the Maximum to 1000 and at the time of setting the value you can put 99.2 * 10 = 992,…
-
1
votes2
answers73
viewsA: taking out the commas and sorting with php mysql
If you have already used the explode, then $separate is already an array, then it is more practical to go through the array using the foreach instead of while. foreach($separar as $item){ /*Aqui,…
arrayanswered Júlio Neto 1,228 -
1
votes1
answer38
viewsA: Doubt regarding Join with multiple tables
The @Joincolumn is for you to inform the column of table q references another table. For example: if you have the Sale table, this table should have a column where you inform the customer (clienteId…
-
2
votes2
answers132
viewsA: Do I really need to start from a main to run a Schedule in java?
The most standard way to do this is to use timers of Javaee. In your example, you could do so: @Singleton public class ScheduleBases { @Schedule(hour="02/24", minute="30") public void…
-
0
votes2
answers61
viewsA: Relationship problems @Manytomany
Try adding Calendar in the relationship. Ex.: @Manytomany(Scade={Cascadetype.PERSIST, Cascadetype.MERGE})
-
2
votes2
answers43
viewsA: See if any of the array value exists in a string?
The problem is that even when you encounter an error, the is keeps running, you must stop the execution of the is as soon as error = 1, moreover, you do not need to set the value error = 0 no for,…
jqueryanswered Júlio Neto 1,228 -
0
votes2
answers529
viewsA: How to make a minimum ceiling and a maximum ceiling in a random number?
You must call nextFloat or nextDouble, that return decimals between zero and one and make the transformations you need. More or less like below: (int) min + (random.nextFloat() * (max - min)); This…
-
1
votes2
answers1285
viewsA: Number of simultaneous requests a PHP server supports
Applications are not limited to the threads and colors of the processors. In fact, only the operating system has access to these low-level threads. And systems typically have Apis so that…
-
1
votes2
answers172
viewsA: problem with data validation preg_match
Just add a s to your regex, like this: [a-za-Z d s] I also traded 0-9 for d just to show that you can do it like this.
-
-1
votes2
answers46
viewsA: Error declaring Jtextfield vector in class
You forgot to give a new in the array: JTextField campos[] = new JTextField[]{campoNome, campoUsuario};
-
0
votes1
answer253
viewsA: How to paginate a foreach of a file_get_contents?
You need to paginate the data in the Slice array. Considering that the first page has Dice zero, it would look something like this: foreach (array_slice($json['GET'], $pag * $reg_por_pag,…
-
3
votes2
answers236
viewsA: How to count the number of bits of a text using java
You just need to know the number of bytes and multiply by 8. For example: System.out.println("teste".getBytes().length * 8); //40
javaanswered Júlio Neto 1,228 -
0
votes2
answers60
viewsA: Problem with inifnito loop Randomaccessfile
You can simply call Arq.read() before and at the end of while and put the value into a variable and test this variable. So you can read the value after without walking the file pointer.
-
2
votes1
answer46
viewsA: Android and Stream Java 8
If the goal is to return one object only, I would swap the Collect snippet and get it by: .findFirst(). orelse(null) And if the list is already specialties, the map is redundant.…
-
1
votes1
answer49
viewsA: Problems Webservice ASMX
I can’t say for sure, but a guess: when informing the response size in Content-Length, use the byte size, not the number of characters in the string. This can occur because accented characters add a…
-
1
votes1
answer18
viewsA: Take data from an rss
Since you didn’t report the error, I can only guess from the code that the problem is on the line:…
phpanswered Júlio Neto 1,228 -
3
votes1
answer294
viewsA: JSP with Servlet
It is probably because there is no input on the page with the name="acao", and that is why the acao variable is null. In the Submit of the page you put acao="Entrar" and value="Login", but what you…
-
0
votes2
answers2120
viewsA: What’s the difference between "this" and "$Scope"?
"$Scope", is a special angular variable, which holds the controller context data. "this" is a reserved javascript word, which always points to the object where the method is running, if the method…
-
1
votes2
answers172
viewsA: Who assigns my ip?
It is always the DHCP server. The point is that since the internet is a network, there are several layers that can change this. For example. if your pc is connected directly on the modem, the DHCP…
-
0
votes1
answer106
viewsA: XML Parser in PHP does not work
the error is on this line: foreach ($rss->boutique->produto as $item) { pq $rss->boutique->product is null What happens is that boutique is the root element, and therefore is already…
-
0
votes1
answer37
viewsA: create a mysql triggers that reorganize the numbering of a field when one of those fields is deleted
I don’t know how triggers work in Mysql, but in theory, you just need to decrement all the positions below the one you removed, it’s a simple SQL: update usuarios set posicao = posicao - 1 where…
-
2
votes1
answer1431
viewsA: Sessions or Cookies for login system?
Still, use sessions, cookies can also be removed by users, can be read by some malware that the user has on the PC. The only correct way to use cookies is only to save the session ID to retrieve the…
-
1
votes1
answer366
viewsA: Pass parameter in Bundle
You will use the function String format. for that reason. For example instead of using: public static void sucesso(String mensagem) { FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO,…
-
3
votes2
answers433
viewsA: Connection database in Unity
Unity does not have database support, instead you can use an XML or JSON file if it is limited data. If there are many, better use some service over the internet. To help:…