Posts by Sabrina • 909 points
81 posts
-
0
votes1
answer32
viewsA: Problems with numerical operations and Javascript Nodelists
With the help of the comments I was able to adjust the code. The problem was in selecting the numbers that were occurring so that they would stay in a Nodelist: let firstNumber =…
javascriptanswered Sabrina 909 -
-1
votes1
answer32
viewsQ: Problems with numerical operations and Javascript Nodelists
I’m doing a simple summing function, which takes 2 html numbers, sums and should include a div for the result. <section class="container"> <h1 class="title">Somando os valores <p…
javascriptasked Sabrina 909 -
-1
votes2
answers812
viewsQ: Abbreviate names with javascript
Hello I am wanting to write a function to reduce names by passing a limit, for example: limit 10 to the name: Sara Flávia Cristina to Sara F. C. I wrote the code below, but I wonder if there’s a…
-
1
votes1
answer75
viewsA: Error wordpress paging (after second page) using custom template
The solution was to change the way posts per page (posts per page): query $postStatus = 'publish'; $postPerPage = 1; $pageType = is_page() ? 'page' : 'paged'; $paged = (get_query_var($pageType) ?…
-
1
votes1
answer75
viewsQ: Error wordpress paging (after second page) using custom template
I made a custom page to show the blog post files, but would like to add pagination. When I make the pagination I can see only the first page, from the second page and all the next ones are not shown…
-
0
votes2
answers44
viewsA: Help to round value returned from function
Try to add this at the end of your code: troco = troco.toFixed(2); console.log(troco);
-
0
votes1
answer67
viewsA: Java: generating the design of a non-deterministic finite automaton (NFA)
After a lot of research I found this java library that assists in the automat print: https://github.com/nidi3/graphviz-java…
-
1
votes1
answer67
viewsQ: Java: generating the design of a non-deterministic finite automaton (NFA)
I am making a program that receives a text file with parameters of a nondeterministic automaton, from it rules are created for this automaton, with ifs where each state should go. However in the end…
-
0
votes1
answer874
viewsQ: Angular 7: How to update the html variable automatically when its value is changed in the . ts file?
I have a variable that gets value when the page renders, and it looks right in the template. However if I change its value with the page already loaded the value in . ts is updating (checked with…
-
1
votes5
answers2183
viewsA: Save items and recover values with Localstorage
Taking content from Localstorage and playing an input: let storageValue = JSON.parse(localStorage.getItem(myKey)); document.getElementById(myInput).value = storageValue; If you have multiple values…
-
1
votes2
answers874
viewsA: Java: create Inner Join using criteria
After much research I managed to arrive in this solution unifying the 2 queries and using the Internet: //criação da query CriteriaBuilder builder = entityManager.getCriteriaBuilder();…
-
1
votes2
answers874
viewsQ: Java: create Inner Join using criteria
I’m having a hard time finding good examples of how to create a query criteria using Inner Join. I created the query below that would be what I would like to do with the criteria. SELECT DISTINCT *…
-
0
votes1
answer315
viewsA: Angular: error trying to manipulate input value - Property 'value' does not exist on type 'Element
The problem was of the type that could not be Element, I was able to solve with the code below, converting from Element to Input: (document.querySelector('.input') as HTMLInputElement).value = "";…
-
0
votes1
answer315
viewsQ: Angular: error trying to manipulate input value - Property 'value' does not exist on type 'Element
I’m having trouble trying to get the value of an input to clear it, the code is in a script . ts (used in Angular 7), code below: document.querySelector('.input').value = ""; Error while compiling…
-
0
votes3
answers3120
viewsA: Javascript: get the value of a textarea (not working)
The problem is that this textarea was inside a modal, of for some reason the field is duplicated when opening the modal, so I have 2 textarea with the same id Description. To solve I did as follows:…
-
-2
votes3
answers3120
viewsQ: Javascript: get the value of a textarea (not working)
I have a simple textarea but I can’t get the value typed in it, which is pretty weird, code below. HTML <textarea type="text" class="textarea" id="description2"></textarea> //Digitei…
-
1
votes3
answers1339
viewsA: Angular 7: pass the service from one component to another per parameter
I found a way to do this, the only modification for in the code above is to instead of passing the Service, have to pass the service, the service call of the parent component. Before…
-
1
votes3
answers1339
viewsQ: Angular 7: pass the service from one component to another per parameter
I’d like to pass a service as a parameter between two components, from father to son. The communication between the components is okay, I am receiving the service, but when I try to use the…
-
-1
votes1
answer944
viewsQ: Java: find files in directory
I have a simple function to search a file in the application directory and return it, however the return is always being empty, I could not find where the error is. Path currentRelativePath =…
-
-1
votes1
answer142
viewsQ: Angular 7: How to identify the Encounter of a File?
I have a function that runs when uploading files, I would like to identify the type of this Encounter. I am using the code below. async uploadFile(event) { var document; var reader = new…
-
1
votes1
answer1396
viewsA: Java spring: convert a file to Multipartfile
I found a way to do that: File file = new File("text.txt"); InputStream stream = new FileInputStream(file) MultipartFile multipartFileToSend = new MockMultipartFile("file", file.getName(),…
-
0
votes1
answer1396
viewsQ: Java spring: convert a file to Multipartfile
I created a simple file: File file = new File("text.txt"); But I would like to convert this to a Multipartfile, which would be the best way? I have tried the code below without success:…
-
1
votes2
answers581
viewsA: Angular 7 / Typescript error: Property 'result' does not exist on type 'Element'
The solution was very simple, just remove the type Event of the variable e and add any. async uploadFile(event) { var reader = new FileReader(); let file = event.target.files[0]; reader.onload =…
-
0
votes1
answer649
viewsA: Java Spring: create a file and offer this for download via api
Well, I found a way to do, I do not know if it is the most correct, but this function is returning me the link of the generated file. Documentcontroler.java //passo o título do arquivo que tenho…
-
0
votes1
answer649
viewsQ: Java Spring: create a file and offer this for download via api
Hello I have some documents saved in the database (with equivalent templates, they are not .txt files or anything), I would like to create . txt and . Md from the database, searching for the…
-
1
votes2
answers581
viewsQ: Angular 7 / Typescript error: Property 'result' does not exist on type 'Element'
I have a function that runs while performing the upload of files, however I am having an error in result within the function onload. This mistake makes no sense because if I give one console.log in…
-
0
votes1
answer408
viewsA: Angular 7 / Typescript: grab value from within an onload function (upload files, grab content from a file)
The problem I was having was that the content of the onload function happened after the rest of the code, leaving this data as null. Solution, redo the function async uploadFile(event) { var reader…
-
5
votes1
answer661
views -
4
votes1
answer661
viewsQ: Java spring: Infinite recursion (Stackoverflowerror) error
I’m having trouble carrying out the method list of translations of the document, I’m not understanding the reason for the error, follows code: Translation.java @Getter @Setter @NoArgsConstructor…
-
0
votes1
answer50
views -
0
votes2
answers351
viewsA: Angular error when returning function string in service: Type '() => string' is not Assignable to type 'string'
The problem was I was calling this.testeService.getOneString, and should be called was: this.testeService.getOneString() Also as commented the other problem was this.service, which should be…
-
0
votes2
answers351
viewsQ: Angular error when returning function string in service: Type '() => string' is not Assignable to type 'string'
I’m having the following problem while trying to return a string of a variable of service for any other function, which is strange because all variables are strings like the return of functions.…
-
1
votes1
answer119
viewsA: Angular: Webpack has been initialised using a Configuration Object that does not match the API schem
The solution was to remove the entire project, create a new one, and add the dependencies one by one.
-
0
votes1
answer119
viewsA: Angular - npm: how to give up the webpack?
The solution was recreate the project again do a clean Node installation
-
0
votes1
answer119
viewsQ: Angular - npm: how to give up the webpack?
I am trying problems with the webpack, I would like to know how to remove it, tried the ways below which are indicated as examples on the NPM website, but without success.…
-
-1
votes1
answer119
viewsQ: Angular: Webpack has been initialised using a Configuration Object that does not match the API schem
I started having this error in my app at Angular 7, already tried to remove module folder, install, remove cache and nothing, the error remains. Invalid Configuration Object. Webpack has been…
-
0
votes1
answer408
viewsQ: Angular 7 / Typescript: grab value from within an onload function (upload files, grab content from a file)
I have the code below where I upload a file and want to get its contents in a variable. For this I use the function onload that gets me the result, which is the contents of the archive. But the…
-
0
votes2
answers851
viewsA: Required does not work (.Ubmit)
You could do a field validation by doing Submit validating the fields: $( "#form" ).submit(function( event ) { var campo = $("#campo").val; if(campo == "") { console.log("preencha o campo"); return…
-
0
votes1
answer327
viewsA: Angular 7 error: ERROR Typeerror: jit_nodeValue_5(...) is not a Function
The problem was that it had a modal the same name of the function, and the angular if it was to open the modal or fire the function (even used the parentheses), was solved changed the name of the…
-
0
votes1
answer327
viewsQ: Angular 7 error: ERROR Typeerror: jit_nodeValue_5(...) is not a Function
I have a simple page with 3 modals, which are opened by clicking buttons to request yes or no to perform actions. In one of them I only have this error, by clicking the yes button of the…
-
0
votes1
answer50
viewsQ: Angular: error in model with object listing
I have these 2 models, and the book has a list of language-like objects. Model book import { Language} from "./language"; export class Book { id: number; name: string; language:…
-
0
votes1
answer336
viewsQ: Angular: persist get return in function/variable
booksList: Book[]; listById(id: number): Book{ this.http.get<Book>(`${url}/list/id=${id}`) .subscribe((response)=> { this.book = response; console.log(this.book); //aqui existe o livro…
-
0
votes2
answers26
viewsA: Jquery z-index combo box
Add the relative position in the element that should be behind and be the basis for the other, this should be the parent in the html hierarchy of the element that should be in front. The element…
-
0
votes1
answer46
viewsA: Wordpress/PHP: Problems keeping $_SESSION variable when changing page
The problem was that the redirect led to another domain (localhost to localhost ip) making wp believe it was another domain and clear the session and cookies.
-
2
votes1
answer41
viewsQ: Wordpress: multiple queries
I am making queries to search posts according to different parameters of custom fields, but I would like the result of the 3 queries to be displayed together. function query() { foreach ($values1 as…
-
0
votes1
answer18
viewsA: Wordpress: after redirection cookies disappear
The problem was that I had pages that were as localhost, and others with local ip, so these exchanges were identified as different domains and cleared the variables of cookies and session. I…
-
0
votes1
answer18
viewsQ: Wordpress: after redirection cookies disappear
I did a simple redirect with wp_redirect(home_url()); exit(); And after that the cookies are cleared (Session too), which could not happen, how to persist cookies after redirection? From what I saw…
-
-1
votes1
answer46
viewsQ: Wordpress/PHP: Problems keeping $_SESSION variable when changing page
I have the code below in the same file: add_action( 'init', 'iniciaSessao', 1 ); function iniciaSessao() { if(!session_id() ) { session_start(); } } function info() { $_SESSION['nome'] = 'meu nome';…
-
-6
votes2
answers208
viewsQ: PHP - associative array: check the amount of elements within a value (which has an array) of a key
I have an array like this: $array = array( user => "user1", name => "name1", books => "book1", "book2" ); I want to go in Books and check the value that elements have inside it, in case it…
-
-2
votes1
answer79
viewsA: Java: Problems using lambda expressions in generic Listing method
The final version of the code I made with the suggestions from implementation of the double-chained circular list using lambda and Generics (together with the other part of questioning) I played…