Posts by Robson Silva • 897 points
67 posts
-
0
votes2
answers52
viewsA: How to read the {1x2} JSON Jquery key
You can access this way var meuObj = {"1x2": { "outright": false, "interwetten": { "odds": { "1": 6.4, "2": 1.55, "X": 3.95 }, "bookmaker": true, "exchange": false, "name": "Interwetten" }, "bwin":…
-
1
votes1
answer2411
viewsA: How to compare two separate columns in excel and check if the data of one is inside another?
You are specifying that the data matrix for query is just the column B, and you ask to return the index column 2 of the data matrix. However as your matrix is only the column B, this error occurs,…
-
3
votes2
answers88
viewsA: Problem with Python print formatting
I’ve had this same mistake, and solved using the fstrings. put your prints in this format for i, impares in enumerate(impar): print(f"impar[{i}]=", impares) In this format spaces do not appear.…
-
-1
votes4
answers1335
viewsA: How to use . replace() to remove Python strings
Replace works as it will go through your string searching for occurrence of the value passed in the parameter old, and when it finds this value in the string, it replaces the value passed in the…
-
1
votes1
answer62
viewsA: format currency in dynamic span
You can format the value for currency with the function toLocaleString() that is present in the javascript class or int alias. var valor = 55; valor = valor.toLocaleString('pt-BR', {style…
-
4
votes1
answer66
viewsA: How to refer to the attribute itself of a Javascript object?
This is because you’re trying to access data from an object that hasn’t even been created yet, and so it can’t be referenced by itself. You must create it first to then get values. window.matObj = […
javascriptanswered Robson Silva 897 -
0
votes1
answer194
viewsA: I have a return in Json and I want to get the data in C# (CNPJ Data)
Try to deserialize the json object you receive Jsonconvert.Deserializeobject from the Newtonsoft namespace.Json. Link Newtonsoft. You will basically get your json and convert it to a c#class or…
-
1
votes2
answers235
viewsA: How to convert MM/dd/yyyy to dd/MM/yyyy?
Remove the .ToShortDateString() of your insertion query, c# by itself with the object DateTime created in the right format will store the date in the correct format in the database.…
-
0
votes1
answer52
viewsA: Perform sum of hours from a query
A simple way to solve it with no library. Good as you already have the function to calculate the hours worked individually is to make a loop in your array coming from the database passing each date…
-
-1
votes3
answers516
viewsA: How to compare two JSON objects with the same elements in Python
Try trading your loop for for i in range(len(x)): if "IFAB" in x[i]['DiplayName']: if x[i]['FlightID'] == y[i]['FlightID']: print(y[i]['Waypoints']) Because in the format where this variable i loop…
-
1
votes2
answers67
viewsA: How to use Log4net Adonetappender only at Error level
In case someone also needs this information I was able to solve the problem using the Levelmatchfilter to configure the logger level. <filter type="log4net.Filter.LevelMatchFilter">…
-
0
votes2
answers67
viewsQ: How to use Log4net Adonetappender only at Error level
I have a console application and use log4net to display the application logs, however I would like to save only the error logs in the database. I saw that you have the configuration of…
-
2
votes1
answer83
viewsA: Print Owin Identity Projects
You can get all Claims associated with a user with the following code. if(User.Identity.IsAuthenticated) { //Cria um lista de todas claims do usuario. var cliams =…
-
0
votes2
answers655
viewsA: Call the controller via javascript or ajax and insert in table Asp.net mvc
From what I understand you want to insert a new record in the database, but one thing I did not understand, is what information will be registered in the bank, passing only one id ? 'Cause usually…
-
0
votes2
answers55
viewsA: Javascript does not change the <div>
Try to put your javascript code inside the event onload html document, so you ensure that your javascript will only be executed when every document is loaded. If using Jquery use the function…
-
3
votes1
answer132
viewsA: Relationship one-to-Many Entity Framework
In your class Employee you have created the browsing properties and the property that receives the foreign key value, but at no time informs Entity that it should use this property as the foreign…
-
1
votes1
answer56
viewsA: Relationship 1:N in the Entity Framework
Your Quote class has a customer relationship, so you need to specify the foreign key field in it that will be customer related, which usually uses ClienteId, but it is not necessary to be this name.…
-
0
votes2
answers823
viewsA: Sum of decimal values in Javascript
You can use Math to round the spool, or simply make the conversion to float. Math.floor(1.25+1.36) //Resultado 2 , Valor arrendado para baixo Math.ceil(1.25+1.36) //Resultado 3 , Valor arrendado…
javascriptanswered Robson Silva 897 -
0
votes2
answers59
viewsA: Convert a date from C# (Datetime), which has been transformed JSON, to Javascript Date
I recommend using a librarian called Moment, she already takes care of making this conversion for you without needing much effort. var data = moment(dataDoResponse);…
-
1
votes1
answer369
viewsA: Linq - filters between dates
Araujo. This is because c# prevents the Sqlinjection attack, where the data you saw from the outside, in case passed by the user, can be malicious and to ensure that this does not occur, it creates…
-
0
votes2
answers32
viewsQ: Timeout Connectiostring
I have a question about the Timeout value that can be passed in Connectionstring, this value is related to seconds or milestones? <connectionStrings> <add name="MyConnection"…
-
0
votes1
answer85
viewsA: Join C# EF6 lambda Expression
I managed to solve, in my case the problem was in the bank because these columns had to be not null and were as null and so error in searching, I changed all to not null and now it’s working.…
-
1
votes1
answer85
viewsQ: Join C# EF6 lambda Expression
I’m having a problem, I’m doing a Join with C# with EF6, I have two unrelated tables Invest and Encarteiramento and need to make a Join in Invest where agency and account is equal to, agency and…
-
2
votes0
answers93
viewsQ: Java script does not recognize object
I’m having a problem where my Javascript code when I started IE11 my object core is not recognized, however in any other browser works normally, which might be causing this loading error. Core code…
-
-1
votes1
answer33
viewsQ: Convert a string to number
I am reading in an excel file, but the values of them are coming in this format. "-3,6379788070917E-12" Code for conversion from string to decimal. decimal.Parse(linha[5]); When I do the error…
-
0
votes4
answers1357
viewsA: associate a checkbox to a script function
You can use the selector $('input:checked') to obtain the selected checkbox inputs, and with the selected and captured input you call its function Teste trachilately. var chekbox =…
-
0
votes5
answers815
viewsA: Check if URL has string
Try to use. window.location.pathname It brings all the text of the url, without the hostname and port part, only the part after the domain. Example: https://pt.stackoverflow/qustion/ Would return:…
-
1
votes3
answers279
viewsA: Regular expression to ignore quote separator
People I managed to solve with the code below // mangled code horribly to fit without scrolling public static class CsvSplitter { public static string[] SplitWithQualifier(this string text, char…
-
3
votes3
answers279
viewsQ: Regular expression to ignore quote separator
I have to read a csv file with delimiter ;. Only it has lines with values """Analize;Distribuição""", only that it creates another column in this ;. How can I read so he won’t accept ; in quotes as…
-
0
votes1
answer44
viewsA: How to connect two Applications in the same instance of Localdb
I was able to resolve this issue using a locally installed Sqlserver instance on the machine. So I was able to access without problem the same base in two different projects.
-
0
votes1
answer44
viewsQ: How to connect two Applications in the same instance of Localdb
I have a problem when connecting with the same instance of localDb in another application in the same solution. Detailing the project, I have an ASP . NET MVC5 application in the solution and also…
-
2
votes1
answer48
viewsA: jinja2 error: jinja2.exceptions.Templatesyntaxerror: Unexpected '%'
The tags for, are wrong. {% for companie in companies %} ... {% endfor %}
-
0
votes1
answer143
viewsA: How to handle the return of files (PDF) in an AJAX call?
Ajax is a way to get data from a server without the need to reload the page, but it expects to receive a JSON with data from the server. You can save the file to your server and send as a response…
-
1
votes2
answers137
viewsA: How to use Readkeey in C#
You can in place of Console.ReadKey(True) use only one break to close the loop is to quit the code. Console.Write( " Se não desejar continuar Press <n> para sair... " ); Console.WriteLine();…
-
0
votes1
answer74
viewsA: How to create a key for an object
You can iterate over your JSON, it is for each JSON element you add its values in paragraph <p> wish. A simple example below. I hope I can help you or shed some light on how to make a more…
-
0
votes2
answers3879
viewsA: How to separate the year from a date with Python and Pandas?
Look I didn’t get to use pandas yet, but in its variable data is a list with column data. It has an easy way to get only the dates' years. import pandas as pd df = pd.read_csv('alunos.csv', sep='|')…
-
1
votes4
answers317
viewsA: Regex to identify all occurrences of years
Try changing the variable rg to obtain more than one occurrence of a group of numbers rg = r'20[1-2]\d+' For in this way its regex searches for one or more occurrence of digits. The part \d is…
-
1
votes1
answer2827
viewsA: How to change the size of the Activex Excel checkbox (Checkbox)?
When you add an activex element, to be able to resize or change any property of the element make sure that the button Design Mode is active, so you can edit your controller. This button is on the…
-
1
votes2
answers2495
viewsA: How to make an array with attributes or objects of a class?
Hello The code of Eden is very complete, with a very good code, I advise you to implement and try to see if it fits perfectly, however I want to say that it intends to continue with its…
-
0
votes2
answers72
viewsA: Send several files in a form
You can put the attribute multiple in his input to select more than one file in a single input, thus <form name="myForm" method="POST" action="back_img.php" enctype="multipart/form-data">…
phpanswered Robson Silva 897 -
2
votes3
answers703
viewsA: How to leave the program open in python
To make a code run forever and you dehydrate when the code should use while True: while True: lista=open('item.txt','r') for linha in lista itens=linha.split() print('Comprar', itens[0])…
-
0
votes3
answers55
viewsA: Jquery.text does not work
Strange was supposed to work, so try using the .html() and see if it works. $horas.html("dafuck"); $minutos.html(minutos); $segundos.html(segundos); Make this change and see if it works.…
jqueryanswered Robson Silva 897 -
4
votes5
answers1048
viewsA: What is the use of knowing how to debug a code in R?
I don’t know the R language but I’ll talk about the debbug as a whole. The debbug itself, independent of being for data analysis, as for a web system code, you know how to debug your code, helps in…
-
5
votes1
answer1061
viewsA: How to use the title() method in Python?
The function title() is a function that is associated with str of Python, that is, you can only use it if it is in a string. If you have a list of strings and wants each of the list to be…
pythonanswered Robson Silva 897 -
1
votes2
answers1240
viewsA: How to add characters in a string according to a predefined condition?
Opa Jhonathan, beauty! Guy according to your question, you want to scroll through a string and find a matching 4-character track and add the letter c after the 4-character. Well when I started…
pythonanswered Robson Silva 897 -
2
votes1
answer55
viewsA: Where can I find Python’s methods?
If you just want to see the methods you can use already embedded in python, without seeing the implementations, you can use the dir(__builtins__) With this it will show all builtins methods…
pythonanswered Robson Silva 897 -
1
votes2
answers6846
viewsA: How to cut string text in python by delimiting the initial substring to the final position?
Opa Marcos, all good. Man from what I understand you’re needing a function to make cuts in certain texts, where you pass the text the starting position and the amount of characters apart from that…
-
0
votes1
answer112
viewsA: Create database and superusers automatically with Django
In case your application must have an implementation to give users who are registered, superuser permission. I recommend reading the Django documentation in the user creation section. I believe that…
-
0
votes3
answers62
viewsA: Function returns value only the first time it is executed
Jonp, tries to make a loop in his function to collect data, because in it you, make a Yield in data, it is with Yield your function becomes interable, having the need to interact in it to obtain the…
python-3.xanswered Robson Silva 897 -
0
votes2
answers3821
viewsA: Python iloc[] function (Pandas)
I didn’t get to use pandas, so I didn’t get to use this method, from what I read, iloc, is a data selection method, and according to this site, its structure works as follows: data.iloc[<row…