Posts by Eduardo Sampaio • 1,425 points
80 posts
-
1
votes2
answers100
viewsA: Recursive program that accepts a non-negative integer as input and displays its vertically stacked digits
The idea of recursion sub-divide the problem into problems smaller so it can be solved def vertical(n): if n < 10: print(n) else: vertical(n//10) # // divisão inteira print(n%10) # modulo da…
-
1
votes3
answers12331
viewsA: has been blocked by CORS policy: No 'Access-Control-Allow-Origin'
can try like this @Configuration @EnableWebSecurity public class SecutiryConfig extends WebSecurityConfigurerAdapter { private static final String[] PUBLIC_MATCHERS = { "/h2-console/**",…
-
0
votes2
answers1309
viewsQ: How to make Redirect on the page with Django
How to redirect passing an object as parameter in Django already tried redirect() and HttpResponseRedirect but I can’t send an object to page in Sponse, every time I hit F5 it wants to resend the…
-
0
votes1
answer474
viewsA: Transform excel file into array - python
import pandas as pd import numpy as np from pandas import ExcelWriter from pandas import ExcelFile df = pd.read_excel('file1.xlsx') array = np.asarray(df) // transformar em…
-
2
votes2
answers4274
viewsA: Export table (in pd.Dataframe) to csv - Python format
export csv df = pd.DataFrame({'name': ['Raphael', 'Donatello'], 'mask': ['red', 'purple'], 'weapon': ['sai', 'bo staff']}) csv = df.to_csv(index=False) export in xlsx df1 = pd.DataFrame([['a', 'b'],…
csvanswered Eduardo Sampaio 1,425 -
1
votes2
answers203
viewsA: When to use "Try catch" in layered application?
1- I prefer to handle errors in a higher layer like controller. 2- You will not miss stacktrace in the first error that Try catch catch will treat it and launch the Exception. 3-When to use ? you…
-
1
votes1
answer79
viewsA: Error calling add in a Hashset
public class Agencia { private String nome; private String endr; Set<Conta> listaContas = new HashSet<Conta>(); private int nrAgencia; public…
-
0
votes3
answers1771
viewsA: 'Access-Control-Allow-Origin' error
A definition of what is happening Browser security prevents a web page from making requests for a domain other than the one that served the web page. This restriction is called a policy of the same…
javascriptanswered Eduardo Sampaio 1,425 -
0
votes1
answer159
viewsA: GIT and Jenkins branch check time
you can configure webhook from your git server so that every push is fired into your Jenkins a request so that it can perform the task,detail if using your localhost Jenkins you have to use some…
-
0
votes2
answers83
viewsA: What does each signal mean in this assignment in C#?
mainSize = mainSize < 0 ? 20 : mainSize ; ? é igual ao if if(mainSize < 0){ } : igual ao else else{ } mainSize < 0 se 20 senão…
c#answered Eduardo Sampaio 1,425 -
0
votes0
answers237
viewsQ: Oracle 11G XE change size tablespace system
I have following script: DECLARE countTablespaceFile integer; BEGIN SELECT count(*) INTO countTablespaceFile FROM DBA_DATA_FILES where file_name in ('/oracle/bdond/cbiep01/bdrgt/system01.dbf',…
-
0
votes2
answers37
viewsA: How to make a selection with javascript
can try asssim by calling an event on the clicked line and passing this that will catch the object in question get and a function that will be called uses console log <div class="test8 lo"…
javascriptanswered Eduardo Sampaio 1,425 -
0
votes2
answers107
viewsA: Array search by name
var msg = ["Orange", "Melancia", "Abobora"]; var buscar = nome => msg.filter((elemento) => elemento.toLowerCase() === nome.toLowerCase()) calling function buscar("Melancia")…
javascriptanswered Eduardo Sampaio 1,425 -
0
votes1
answer644
viewsA: Angularjs: Picking input value in keypress
follow the example <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge">…
-
2
votes1
answer4221
viewsQ: Asp.net web api From Ri and From Body when to use?
Asp.net web api that serves [Frombody] and [Fromuri] and when there is real need to use ? example: public IHttpActionResult Get([FromUri] email) { } public IHttpActionResult Get([FromBody] email) {…
-
3
votes2
answers1000
viewsA: Git log command for all commits of a specific file
git log --follow arquivo In all branches git log --follow --all arquivo
gitanswered Eduardo Sampaio 1,425 -
2
votes1
answer362
viewsA: How Does Life Cycle Dependency Injection Work?
Singleton : A service object is created and provided for all requests. Thus, all requests get the same object; Transient : will always generate a new instance for each found item that has such a…
-
2
votes1
answer362
viewsQ: How Does Life Cycle Dependency Injection Work?
How the 3 life cycles of a dependency injection works such as Singleton, Transient and Scope ?
-
2
votes4
answers2882
viewsA: How to extract data from an SQL query in C#
1-class connection using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Data.SqlClient; //ADO.Net padrão para SqlServer…
-
1
votes1
answer162
viewsA: How to read class data
In your case you can use foreach [HttpPost] [Route("unidade/carrinho/ConsultaUnidadeAtendimento")] public HttpResponseMessage ConsultaUnidadeAtendimento(TB_DADOS_API consultaAtendimento) { try {…
-
1
votes2
answers438
viewsA: Api with Item Array does not receive the posted data
tries to send JSON object changes in Postman so you work with object becomes simpler public class Model { [JsonProperty("numeroCarrinho")] public long NumeroCarrinho { get; set; }…
-
0
votes3
answers130
viewsA: How do I call the next field of a table with Javascript or Jquery?
1- use data-index in input to give shift order to next <input class='ui-widget-content ui-corner-all form-fullwidth' data-index="1" id='Tasudok' name='Tasudok' value='' maxlength='25' />…
-
0
votes2
answers1243
viewsA: Receive images in ASP.Net Core and save to Entity Framework
//Convert IFromFile para base64 private string ConvertIFromFileToBase64(IFormFile file) { Stream stream = file.OpenReadStream(); using (var memoryStream = new MemoryStream()) {…
-
1
votes2
answers477
viewsA: Nodemon and Nodejs
1- install nodemon dev dependencies npm install nodemon --save-dev 2-setting start "scripts": { "start": "nodemon seu-arquivo.js" }, 3- turning npm start…
-
2
votes2
answers126
viewsA: How to insert a Where into a Linux query
var result = (from line in db.ApadrinhamentoListas where line.ong_receptora == "valor" group new { line } by new { line.datahora, line.valor_doacao } into grp select new { DataHora =…
-
0
votes2
answers1321
viewsA: String Comparison in jQuery
$("#botao").click(function() { var verificarcidade = $('#cidade').val(); console.log(verificarcidade); if (verificarcidade.replace('â','a').toLowerCase() != 'goiania' &&…
-
1
votes1
answer445
viewsA: Return Javascript script with Node.JS
need to map the static files with this you will be able to use in their pages the files (css,js,etc..) var express = require('express'); var app = express(); //Middlewares…
-
4
votes1
answer1024
viewsA: Using a root directory in the Nodejs include
__dirname This gives you the currently running file path __filename This is the absolute path of the current module file example console.log(__filename); // Prints: /Users/mjr/example.js…
-
4
votes1
answer579
viewsA: How can I add Headers to an Httpwebrequest
Examples: Httpclient: client.DefaultRequestHeaders.Accept .Add(new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Authorization = new…
c#answered Eduardo Sampaio 1,425 -
2
votes1
answer71
viewsA: How to use SUM in a string field by converting the value to int?
tried to make a value Parse: Int32 somaBpaC = modelOff.bpacs.Sum(p => int.Parse(p.pa));
-
2
votes1
answer62
viewsA: Install . Net Core SDK and Runtime from the Windows terminal?
using Chocolatey Link:https://chocolatey.org/ can do this choco install dotnetcore-runtime Link:https://chocolatey.org/packages/dotnetcore-runtime…
-
2
votes1
answer614
viewsA: Error while sending Nfe
I did not do with authorization but it is so my used Nfedistribução and event reception below configuration of webconfig: <binding name="RecepcaoEventoSoap"> <security mode="Transport">…
-
11
votes1
answer744
viewsQ: What is the difference between save and Insert in Mongodb?
What difference in the Mongodb between insert item with save and with Insert ? Example: db.pessoa.insert({"nome":"João"}); db.pessoa.save({"nome":"Maria"});…
mongodbasked Eduardo Sampaio 1,425 -
0
votes2
answers1155
viewsA: Mysql with Nodejs: insertion of records
dbconnection file: var mysql = require('mysql'); var connMysql = () => { return mysql.createConnection({ host: 'localhost', user: 'root', password: '1234', database: 'banco' }); } module.exports…
-
0
votes2
answers554
viewsA: Where to place a non-entity object in the DDD
The Domain layer in the DDD where all your business rules are located should not have any kind of coupled technology. But answering your question whether from what I understand where you will have a…
-
1
votes2
answers2537
viewsQ: How to Read and Convert . xsd Extension File to a C#Class
How to Read and Convert . xsd to a C# class for this purpose and convert the schema of the site Sefaz to can generate an xml with correct schema to be able to emit NFE.
-
3
votes2
answers755
viewsA: What is #pragma c#
The #pragma provides the compiler with special instructions for compiling the file in which it is displayed. The compiler must support the instructions. In other words, it is not possible to use…
c#answered Eduardo Sampaio 1,425 -
2
votes0
answers493
viewsQ: How to schedule tasks for a given time C#
I need method to perform tasks every day at the same time which class should I use for this type of task?
-
1
votes3
answers899
viewsA: NOT EXIST ? How to use
NOT EXISTS works contrary to EXISTS. The WHERE clause in NOT EXISTS will be met if no line is returned by the sub-label. SELECT Name FROM Production.Product WHERE NOT EXISTS (SELECT * FROM…
sqlanswered Eduardo Sampaio 1,425 -
0
votes1
answer62
viewsA: Web API Controller Standardization
As this working micro service I believe the best way is to leave separate even Pedidocontroller api/orders api/orders/10 Itemcontroller api/item // all items api/item/{id} // item with given id…
-
0
votes1
answer283
viewsA: Validate Business Rule
public class Usuario : Pessoa { [Key] public int Codigo { get; set; } private string nome; [LoginDisponivel(ErrorMessage = "Erro. Este Login já encontra-se em uso. Tente outro.")]…
-
1
votes1
answer312
viewsA: Receive Token through Webrequest?
var clientrest = new RestClient(baseUrl); var requestToken = new RestRequest("oauth/token", Method.POST); requestToken.AddParameter("grant_type", "password"); requestToken.AddParameter("username",…
-
0
votes4
answers8807
viewsA: How to insert a property into a javascript object?
arrayInformacoes = [ { Data: "Mar 20, 2017 12:00:00 AM", Atividade: " 23 GERAR", Observação: "Processo cancelado por: Administrador - as", Usuário: "afo" } ] data2 = { "desColigada": "Empresa fulano…
-
1
votes1
answer428
viewsA: Save Token to User Machine
//Armazenando o token com localstorage localStorage.setItem('nomedotoken', token); //Obtendo token com localstorage var token = localStorage.getItem("nomedotoken"); //Armazenando o token com…
-
4
votes3
answers14534
viewsA: What is the INDEX index in Mysql for?
Indexes are auxiliary access structures associated with tables and that aim to increase the performance in the execution of queries. there are two types of index: Clustered: this ordered…
-
1
votes1
answer400
viewsA: Implement Oauth server
class for implementation of the Oauth specification public class OAuth { /// <summary> /// Configurando o OAuth /// </summary> public static void ConfigureOAuth(IAppBuilder app) {…
-
1
votes3
answers109
viewsA: Prompt in javascript does not redirect
<script> function fnPage(){ var page = prompt("Para qual página deseja ir?"); if (page!= null) {//so corrigir aqui nessa linha page dentro do parenteses …
-
1
votes2
answers1272
viewsA: Convert int to Hex
int intValue = 182; string hexValue = intValue.ToString("X"); int intAgain = int.Parse(hexValue,System.Globalization.NumberStyles.HexNumber);
-
0
votes3
answers7208
viewsA: How to select Digital User Certificate in Web Applications?
I did as follows using A1 private RecepcaoEvento.RecepcaoEventoSoapClient _nfeRecepcao; _nfeRecepcao.ClientCredentials.ClientCertificate.SetCertificate(StoreLocation.CurrentUser, StoreName.My,…
-
1
votes1
answer171
viewsA: configuring Entityframework C# and SQL Server
in the project where your web config is set as the main one should contain this in your string Connections providerName="System.Data.Sqlclient" example: <connectionStrings> <add…
entity-frameworkanswered Eduardo Sampaio 1,425