Posts by Marconi • 17,287 points
267 posts
-
2
votes1
answer25
viewsA: Insert password entityframework
When you set up Asp.net Identity you set rules on how it should behave, for example: services.AddIdentity<AspNetUser, IdentityRole>(options => { options.Password.RequiredLength = 6;…
entity-frameworkanswered Marconi 17,287 -
2
votes1
answer367
viewsQ: How can I see the SQL generated by Entity Framework Core?
I am using version 3.1 of EF Core, and I am trying to see the SQL generated from this code: var query = Db.Set<Area>() .Include(i => i.Extratos) .Include(i => i.Coordenadas) .Where(x…
-
0
votes2
answers1073
viewsA: Google Maps does not work after Gero APK Signed for Google Play
After reading my key.Store keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android I limited access to Apis only to my launch…
-
4
votes1
answer2407
viewsA: Warning: componentWillReceiveProps has been renamed
According to the documentation React some life cycle methods of a React component will be discontinued, they recommend using the npm codemod to rename this method. Footsteps: npm i -g react-codemod…
-
2
votes2
answers183
viewsA: Docker Compose image container
I have a Docker-Compose with the settings of Elastic and of Kibana, just you enter the other service you want, if you copy this code from here care with identation. To climb the services is enough…
-
1
votes2
answers1053
viewsA: How to install Node.js in its latest version (12.x) from the Ubuntu terminal?
I install using Node Version Manager, not least because the apt-get not always have the most current and unstable version. First on the terminal install the package using Curl or wget, just run one…
-
1
votes1
answer205
viewsA: Unable to load script. Make sure you`re either running a Metro server
This problem happens because in linux (at least not in mine either) the packer is not started automatically. What you should do is open a new terminal tab in the same project path and run npm start.…
-
0
votes2
answers40
viewsA: Why does this component created with function not work?
When you export an object, example: export { func1, func2 } When importing you should use the destructuring, new ES6 Feature which aims to extract properties from an object or even values from an…
-
2
votes3
answers66
viewsA: Get Function value in javascript
The best way is to create a computed property: computed: { newScrool () { return this.oldScroll > this.scrollY } } To use in another method is enough this.newScrool On the page: {{newScrool}}…
-
1
votes2
answers407
viewsA: How to fire a Redux Action without a React
You can get an instance of your store and use the dispatch. import axios from 'axios' import { logoffRequest } from 'store/actions/userActions' import { store } from '/caminho'…
-
1
votes1
answer1618
viewsA: How to submit a post request with files and json?
I ended up resorting to a code not very familiar(I was just sent a link with a code ready). Explaining: Create a custom model: using System; using System.Threading.Tasks; using…
-
1
votes1
answer1618
viewsQ: How to submit a post request with files and json?
I have a form to send data to my server. In this form I have some input fields and a file upload. This is the sending of my form. submit () { console.log(this.banners) const banners = new FormData()…
-
1
votes1
answer172
viewsQ: React - Redux, how can I modify a complex object?
I am trying to modify some properties of an array through an index coming from mine payload. The code below goes through the array looking for the index and tries to modify its properties. This even…
-
1
votes2
answers65
viewsA: How to identify acronyms with Regex Javascript
This regex solves your problem: /\bP[0-9A-Z]{2}\b/gi Explaining: \b is an important edge for results such as PCCC are not returned, see that there is one more letter. [0-9] range from 0 to 9, ie…
-
0
votes3
answers128
viewsA: Lines with two items according to screen size, is it possible?
My problem is related in this part: <View style={styles.container}> <ScrollView> { this.cards() } </ScrollView> </View> I modified it to: <ScrollView> <View…
-
1
votes3
answers128
viewsQ: Lines with two items according to screen size, is it possible?
My intention is to have lines with two items, and these items should have a width according to the screen size, ie screen 500 , I calculate 500/2 - espaços. It would be something like this. My code:…
-
0
votes1
answer24
viewsA: Error using getDetails() from googlemaps API, Typeerror: this is null (Ionic, angular)
Assuming your mistake is here **this.detalhesfarma = place;**. You have an anonymous callback function that overrides this, you can assign this the other variable before using it in its anonymous…
-
1
votes3
answers293
viewsA: How to know if class instance inherits another class?
You can catch your kind with GetType() and use IsSubclassOf b.GetType().IsSubclassOf(typeof(A)); Type.Issubclassof(Type) Method Determines whether the current type derives from the specified type.…
-
1
votes2
answers230
viewsA: Vuejs "Typeerror: Devices.push is not a Function"
Your problem is that you are referenced to the instance of Vue and not the variable devices that is inside your method. If you want to reference the variable Devices inside the method remove the…
-
4
votes1
answer128
viewsA: How to compare two lists by property?
You can use using System.Linq; var intersect = aluno01.Where(a => !aluno02.Select(b => b.Nome).Contains(a.Nome)); See working in dotnetfiddle…
-
7
votes3
answers259
viewsA: Negative lookbehind only works on Google Chrome, is there an alternative to other browsers?
/(?<!,),(?!,)/ (?!) - Negative Lookahead (?<!) - Negative lookbehind What fails in your code is this part: (?<!), Lookbehinds are only available in browsers that support the standard…
-
3
votes4
answers766
viewsA: How do I capture only the last 2 digits of the current year?
Can use: String.Substring Method DateTime.Now.Year.ToString().Substring(2) Functioning in dotnetfiddle…
-
2
votes1
answer324
viewsA: How to pass ngFor index in ngClass
You just need to concatenate using the +: <td *ngFor="let cell of row; let i = index" [ngClass]="{'col-tb-' + i + '-active' : 'classFocus.col' + i , 'col-tb-' + i : !'classFocus.col'+ i}">{{…
-
3
votes1
answer116
viewsA: Check which items in json have a certain value
Simple, just use method filter() let json = { "deliveryTypes":[ { "name":"5326", "estimatedDays":"7", "price":"R$ 1,09", "stockLevel":"" }, { "name":"3048", "estimatedDays":"2", "price":"R$ 11,00",…
-
1
votes2
answers4619
views -
1
votes1
answer39
viewsA: Error typing numeric values in input
Very likely what’s happening to you boils down to below: Documentation of the Vue If you want the user input to be automatically converted to a number, it can be done by adding the number modifier…
-
7
votes2
answers76
viewsA: How do you capture the time in a String?
This simple regex solves your problem: /\b\d{2}:\d{2}\b/g let texto = '11:11 as 22:22 / 33:33 as 44:44 / 55:55 as 66:66' const expressao = /\b\d{2}:\d{2}\b/g console.log(texto.match(expressao)) \b…
-
8
votes3
answers927
viewsA: Remove a part of the URL
If you need to capture the url you must use the current code window.location.href. If it is static you can do straight as in the code below, just a simple replace. console.log(window.location.href)…
-
4
votes3
answers1300
viewsA: How to remove item from an array by filtering by value?
You can use Javascript Array indexof() Method to find the value index and remove the element from the list using splice (as mentioned in the question). In this example you can directly pass the…
-
3
votes1
answer581
viewsQ: How to turn several asynchronous requests into synchronous?
How could I perform the function sortOrder as soon as the function getOrders complete all requests? The idea is to sort all orders by latest purchase date. Code mounted () { this.user =…
-
4
votes5
answers52381
viewsA: Regular expression to detect credit card flag
For those who work with technologies based on nodejs and want a simpler way that addresses a large amount of cards recommend using the npm Credit Card Type to identify the flag of the card by its…
-
2
votes2
answers144
viewsA: Print the result of a for JS inside a <p>
It only needs a few simple modifications, the main one is that you did not increment the result before the result variable. How are you using innerHtmlyou can even use a <br> to stay one in…
-
1
votes2
answers653
viewsQ: Add object in Localstorage [Object Object]
I have added an object to LocalStorage as follows: user: { authenticated: false, email: '', id: '', cpf: '' } localStorage.setItem('userData', this.user) When will I recover,…
-
18
votes1
answer3663
viewsQ: Why does a return with status code 200 return before a 204?
I have noticed that every answer from Success (200) there is also an answer No Content (204). I was curious and went to search in MDN on status 200, the only thing that says that the success results…
http-statusasked Marconi 17,287 -
2
votes1
answer78
viewsQ: How does this code break the string into parts?
Through that question: How to remove all element from array except the first one in javascript. I adapted the code to my need. var rua = 'RUA NILO PEÇANHA'; const head = ([x, ...xs]) => x const…
javascriptasked Marconi 17,287 -
5
votes3
answers789
viewsA: How is a REGEX Javascript for Mail Tracking Code (AZ123456789AZ)
To the standard AZ123456789AZ, that’s all it takes: ^[A-Z]{2}\d{9}[A-Z]{2}$ Explaining: ^ e $, are an edge representing the beginning and end of a, are important because if a letter exceeds the…
-
1
votes1
answer3152
viewsQ: Error: The apk has Permissions that require a Privacy policy set for the app, e.g: android.permission.CAMERA
I’m trying to publish an APP in my test stores, build works normal, but when I try to publish in the store appears the error described above. For what I have visa it is necessary to inform in Google…
-
3
votes3
answers7703
viewsA: Remove last number with sql
You can use both LEFT and SUBSTRING. DECLARE @numero VARCHAR(MAX) SET @numero = '0495747500000049908275289000100040000000041' SELECT LEFT(@numero, LEN(@numero) - 1) AS 'LEFT', SUBSTRING(@numero, 0,…
-
22
votes3
answers1335
viewsQ: What is the advantage of dependency injection in relation to an object instance?
I’ve been reading and rereading What is addiction injection? but in the end I could not perceive an advantage of the injection of dependence in relation to an object instance. What is the advantage…
-
4
votes1
answer112
viewsQ: How to page a query in Azure Cosmos DB?
I’m trying to pay for a consultation on Azure Cosmos DB, reading this post: Paging through query Results in Azure Documentdb, got to the code: public async Task <ICollection <TEntity>>…
-
7
votes1
answer5356
viewsA: How to remove blank lines in VS Code?
Follow the following steps: Press CTRL+H Select "Use Regular Expression" Search Box: ^(\s)*$\n Replace Box: Leave Blank. Click on Replace All. Final result: Visual Studio Code - delete all Blank…
-
3
votes4
answers717
viewsA: In a sentence, how to know which word has the least characters?
Knowing that each word is separated by space, just divide your sentence into words with code frase.split(' ');, then just check which word with the smallest size through the property lenght.…
-
2
votes3
answers77
viewsA: Find an index of a value in a matrix
Index Searches the specified object and returns the zero-based index of first occurrence within the entire List list.IndexOf("Elefante") Array.Indexof Searches the specified object and returns the…
-
3
votes1
answer219
viewsA: Operation of Array.filter() in Javascript
the filter gets a callback, that is, a function that receives as one of the arguments the elements contained in array. I understand you have a array[{}] of objects, as represented in the variable…
-
2
votes2
answers188
viewsA: Button does not run Javascript
There are several errors in your code: You didn’t properly close that block $('#btnGnrt').click(function() { tamanho = 0,should end a line with ; tamanho = amostra.length;there’s no need for that to…
javascriptanswered Marconi 17,287 -
7
votes1
answer161
viewsA: How to make a function with quantity of parameters 'infinite'?
Use the 3 points before a parameter. It serves for you to use n parameters. Your name is Spread and can be seen more about on documentation. n will be an array within the function multiply function…
javascriptanswered Marconi 17,287 -
3
votes1
answer94
viewsA: Check between date ranges?
I had informed a query in the comments tab that I believe is what you need. Just use the BETWEEN to work with date range. SELECT * FROM Ciclos WHERE dataInformada BETWEEN CiDtIni AND CiDtFim…
sql-serveranswered Marconi 17,287 -
1
votes1
answer35
viewsA: show the value of the child inputs of Divs js
Why not just this? function myFunction() { var inputArray = document.querySelectorAll(".ind input"); for(let i = 0; i < inputArray.length; i++){ document.write(inputArray[i].value +…
-
1
votes1
answer1468
viewsQ: How to submit a post request using Xios and Asp.net Core Web API?
I’m making a requisition with axios with the verb post, but I’m not getting it. Note> With the verb get I can do the requisition. Object cliente: { nomeCompleto: '', cpf: '', email: '', endereco:…
-
1
votes3
answers476
viewsA: Observable returning Undefined
The problem is that you are adding the variable of the component’s scope to itself. You have to add the answer of API the variable restaurants. I modified your method to make it a little clearer.…