Posts by Laerte • 22,243 points
249 posts
-
1
votes1
answer28
viewsA: Typeerror: can only concatenate str (not "_io.Textiowrapper") to str
This error is occurring because you are passing the variable name that opens the file for reading. You should use the variable user because you’ve already made the call of the method .read() on it…
-
0
votes2
answers110
viewsA: Using the for command in Javascript
You can either do @Benilson answered declare the function outside of the looping, or call the function right after declaring, this technique is called self-executing Function which is basically a…
-
1
votes2
answers485
viewsA: Functionality of ! Ispostback
This condition is for the content within this if only to be executed the first time the Page is loaded, because in ASPX every time you interact with the page it makes the Postback.
-
1
votes1
answer26
viewsA: W3C error a tag Name - "The name attribute on the img element is obsolete. Use the id attribute Instead."
I made the change in your code for your slide to work using getElementById, created the variable slideElement that captures the tag img for the id and I also swapped the name for the id in the tag,…
-
1
votes2
answers242
viewsA: Picking up request attribute with Python Json gives error
This error happens because there is no "cnpj_cpf" attribute in your request, you can exchange the call instead of using keys use the method get, example: cpf = request.json.get('cpf', None) In this…
-
1
votes4
answers401
viewsA: Skipping route due to poorly formatted parameter is a syntax error?
No, this behavior is correct, this route you reported does not exist, I made a quick script in JS to exemplify this, where I test the regular expression you are using to validate the route:…
-
2
votes5
answers4459
viewsA: Access dictionary within a Python list
You can use list comprehension if you want to simplify: pessoas = [{'nome': 'ana', 'cpf': '1000', 'endereco': 'rua xxxx'}, {'nome': 'carlos', 'cpf': '8770', 'endereco': 'Rua aaaa'}, {'nome':…
-
15
votes1
answer339
viewsQ: What are they and how do signals work?
Do they exist only on Unix or also on Windows? If so, what would be the equivalent on Windows system? What is the relationship with Signal Handling? A practical example of a Signal Handling can be…
-
1
votes1
answer849
views -
1
votes1
answer3484
viewsA: Console.log displaying all array data
This is because what you are seeing in console.log is the variable reference dados. There are two alternatives to solve this problem: Turn the object into a string and then return it to an object,…
-
2
votes2
answers3618
viewsA: Grab specific column csv with python
Yes, it is possible to read a specific column without using external libraries such as pandas, your code does not work because you did not specify which column separator is on split. I created a…
-
6
votes4
answers455
viewsA: What is the difference between parseint() and operator + before a string?
The first syntax uses unary operator +, which converts the variable to Number. How your question is about the difference using the function parseInt it will also convert to Number but will truncate…
-
5
votes1
answer187
viewsA: How to decode this string in javascript
Try to use the function decodeURIComponent: conteudo = "Tr%E1%BA%A7n_H%C6%B0ng_%C4%90%E1%BA%A1o" console.log(decodeURIComponent(conteudo))…
javascriptanswered Laerte 22,243 -
3
votes1
answer116
viewsA: Capture using Xpath
You can filter by attribute itemprop element, rather than filtering all Ivs that have pricein the class name. I am using the extract_first() to return only the first match and then strip()to remove…
-
1
votes1
answer458
viewsA: Save Excel file to Python via Scrapy
The excel export format is not supported, but scrapy supports: JSON JSON Ines CSV XML You can use CSV format: scrawl nome_do_spider -t csv -o planilha.csv…
-
3
votes1
answer976
viewsA: How to insert dynamic lines in HTML table, and already define a class ante-hand
Just assign the insertCell in a variable and then set the name of the class you want using the property classname var opt = document; function inserirLinha(id) { var newRow =…
-
4
votes6
answers12886
viewsA: Doubt about logical operators && e || in Java
Because || (or) if any of the conditions return true he executes the if. Example: aquaName = "" // (vazio) aquaName != null // verdadeiro !aquaName.getText().toString().isEmpty() // falso Running…
-
3
votes1
answer92
viewsA: Decode javascript-encoded string in c#
Try to use the HttpUtility.UrlDecode library System.Web String teste =…
-
1
votes1
answer67
viewsA: Error trying to encrypt with BCRYPT in Python
The parameter must be of the type bytes, you can call it two ways, giving a cast to bytes hashed = bcrypt.hashpw(b'teste',bcrypt.gensalt()) or using an encoding: hashed =…
-
2
votes4
answers2967
viewsA: How do I put the background on the full screen, CSS?
This happens because you are setting the value no-repeat on the property background-repeat, exchange the value for repeat body { background-image:…
-
2
votes3
answers83
viewsA: How to capture only a specific part of a string?
You can use this expression: (?s)(?<=\<txt_conarq_assunto>)(.*?)(?=\<\/txt_conarq_assunto\>) Functional example: https://regex101.com/r/JUaJDj/1…
-
3
votes2
answers454
viewsA: How to select the checked input?
Filter by input type and add attribute checked to get the value of the checked item. console.log($("input[name='rankeamento_por']:checked").val()) <script…
-
1
votes1
answer332
viewsA: Scratch parameters of a post method, with scrapy in python!
I performed some tests, this problem happens because the page you are trying to submit the form has two elements form. The scrapy is sending the request to the first, but should be the second. To…
-
0
votes1
answer53
viewsA: Parse Xpath from Int
This error happens because the value of the variable t_day is null, you can use an if ternary to solve the problem, returning a default value if the variable is null. int(0 if a is None else t_day)…
-
1
votes1
answer3769
viewsA: How to select a field and type in it with Selenium?
It may be the version of the driver you are using, some functions may stop working between transitioning from one version to another. You can always get the latest version of the Chrome driver here:…
-
3
votes1
answer555
viewsA: Picking json object inside another object
Try the echo double quote: echo $obj->players->online;
-
4
votes1
answer112
viewsA: Replace in empty line
To remove the empty lines you can use the method replaceAll with the regular expression \n+ String tratar = "10\n" + "20 30\n" + "40 50 60\n" + "\n" + "70 80 90\n" + "\n" + "\n" + "100"; String nova…
-
4
votes1
answer39
viewsA: Javascript development
Your syntax to set the property is incorrect, the right is: fontWeight = 'bold' I took and also added the type, so if it is 'over' you arrow to Bold the property if it is not reset to normal.…
javascriptanswered Laerte 22,243 -
2
votes1
answer134
viewsA: Generating Dynamic Table with Jquery
This happens because you are using the JSON.stringify that turns your array into a string. To solve your problem you can do the following: for (i =0; i < arrID.length; i++){…
-
0
votes2
answers6045
viewsA: How to ask questions for the user in Python, without running constantly?
So? If it is I comment on the code later. Demo: https://repl.it/repls/FumblingNaturalModes nicks_consultados = [] while len(nicks_consultados) < 3: print("Quantidade…
-
1
votes2
answers173
viewsA: What is the logic of python for i 'in'
The for x in variavel is the same thing as foreach of other languages. Doubt, it carries the entire typed word on a list in memory and already sorts according to our classification, or it reads…
-
3
votes2
answers592
viewsA: How does Length work outside and inside For in Javascript?
Doubt #1: const numero ="teste"; const medir = numero.length; console.log(medir) Its number variable is of the text type (string) the property length returns the number of characters. const numero =…
-
2
votes1
answer3068
views -
3
votes1
answer2504
viewsA: Remove Oracle Single Quotes
You have to give one escape: REPLACE (teste, '''', '')
-
6
votes1
answer209
viewsA: Share Localstorage with browsers
It is not possible, because the localStorage is an implementation of an HTML5 specification, each browser implements the way it wants and also the location of this data changes from one browser to…
-
8
votes2
answers325
viewsA: Match more than one condition in a junior
Would that be? boolean existe = (idade == 22 || idade == 23);
-
4
votes2
answers99
viewsA: Split in reverse order
Just use the method re-verse. var itens = "101|102|103|104"; var quebra = itens.split("|").reverse(); // inverte o array for (var i = quebra.length - 1; i >= 0; i--) { var unidade = quebra[i];…
-
0
votes1
answer235
viewsQ: Is it possible to use the same column name as a parameter name on a cursor?
I have the following cursor: -- CÓDIGO OMITIDO DECLARE CURSOR CUR_AULAS(IDTURMA NUMBER) IS SELECT ID, IDCLIENTE FROM AULAS WHERE ATIVO = 1 AND IDTURMA = IDTURMA; It will always return true because…
-
3
votes2
answers135
viewsA: How to add the size of all JS files
var getSize = function() { var size = 0; for (var i = 0; i < $("#inputfileSendTorrent")[0].files.length; i++) { size +=…
-
2
votes1
answer116
viewsA: Wordpress calendar plugin
This calendar is looking like the plugin flatpickr. https://chmln.github.io/flatpickr/ I strongly recommend, is the best plugin I’ve ever used! flatpickr("#inline", { inline: true, weekNumbers: true…
-
1
votes1
answer68
viewsA: How to execute a JS function before the so-called Codebehind method?
Add the attribute Onclientclick with the return of its function (must return true or false), if return true it calls the event in Codebehind. <asp:button ID="cmdAvancarEndereco" runat="server"…
-
0
votes2
answers540
viewsA: How does an index improve the performance of a query?
Content you can see as a summary from a book, in the book through the summary it is much faster to find something than you pick up the book and go searching page by page, isn’t it? : ) That’s the…
-
4
votes1
answer58
viewsA: ES6 and addeventlistener(). Why does this method not accept reference from an anonymous function?
You must declare the variable with its function before trying to use it... document.addEventListener('DOMContentLoaded', function() { var click = () => { alert("Clicou"); };…
-
18
votes2
answers8121
viewsQ: What is a Multi-tenancy?
What is Multi-tenancy? What main approaches to implementing it?
-
13
votes2
answers2784
viewsQ: What is the argument limit of the IN operator in SQL Server?
In Oracle are 1000 arguments, which limit in SQL Server?
-
43
votes2
answers843
viewsA: Is it really necessary to put "text/javascript" in the <script> tag?
In the version HTML 4.x, the attribute type is mandatory (W3). This attribute specifies the scripting language of the element’s Contents and overrides the default scripting language. The scripting…
-
4
votes1
answer76
viewsA: How to know if the past object is a DOM element?
You can use the function below, I removed from this reply. function isElement(o) { return ( typeof HTMLElement === "object" ? o instanceof HTMLElement : //DOM2 o && typeof o === "object"…
-
1
votes2
answers142
viewsA: Style sheets (js,css) in subdomain or in a folder within the application?
Probably for reasons of cache and bandwidth saving. Because if you access: http://site.com http://site.com When accessing #1 it will load the js, css files. If you access #2 it will try to load…
-
2
votes2
answers94
viewsA: How to implode to remove characters other than the +(plus) sign with Javascript?
That’s what you want? var valor = "10++-20++30+40+50"; var variaveis = ""; var separar = valor.match(/(\d+)/g); separar.forEach(function(x, indice) { variaveis += "var n_" + indice + " = " + x +…
javascriptanswered Laerte 22,243 -
2
votes1
answer41
viewsA: How to read and understand encapsulated code
Your code is minified, you can use the JS Beautifier to make it legible: window.Gantt = { _seed: 0 }, Gantt.plugin = function(t) { this._ganttPlugin.push(t), t(window.gantt) }, Gantt._ganttPlugin =…