Posts by Jéf Bueno • 67,331 points
1,254 posts
-
4
votes1
answer1660
viewsA: C# AES encryption with MD5
Updating The biggest problem with your approach is to convert the array of byte for string. Normalize data to a string will end up causing some to be lost. If a representation is really needed in…
-
4
votes1
answer160
viewsA: Doubts about routes Angular JS x ASP.NET MVC
First of all, a brief explanation about the two technologies: About the Angularjs He is a framework to write applications client-side. Where you develop Javascript and everything developed there…
-
1
votes2
answers275
viewsA: How to access the database directly from my model class in an ASP.NET Core project?
Just create an instance of the context in this method, exactly as you would any other object IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext vCtx) { var optBuilder…
-
2
votes1
answer31
viewsA: How to differentiate 2 inputs created with for loop and perform operations between them
There are many ways to do this. One of them is to create an array with all the two values entered by the user: n = [] for c in range(0, 2): n.append(int(input('Digite um valor:'))) print("A soma é…
-
6
votes2
answers1019
viewsA: Is it possible to change the name of a JSON position using Javascript or jQuery?
You can do this easily using the function map(). let json = '[{ "id": 1, "total": 50.00 }, { "id": 2, "total": 70.00 }]'; let array = JSON.parse(json); let novoArray = array.map(function(item){…
-
3
votes1
answer38
viewsA: How to remove a user from the server?
The userdel this is what it’s for: $> sudo userdel git If you want to remove the folder home user, use the option -r $> sudo userdel -r git Ubuntu man page on this command.…
-
6
votes1
answer576
viewsA: Delete files by extension
How do you have a collection of strings with the file paths, you can use the method Delete class File. foreach(var arq in arquivos) { File.Delete(arq); }…
-
1
votes2
answers526
viewsA: Passing of parameter Laravel
Use an associative array - see documentation. route('transferir.edit', ['idservidor' => $destino->servidor->idservidor, 'setor' => $destino->setor]);…
-
10
votes1
answer300
viewsA: Can I place two conditions/increments within the same loop?
Can. Note that after the first statement you do not need to specify the type. The increment is correct. I took advantage and added an example of how to put "two conditions". Thus: class Main {…
-
1
votes4
answers829
viewsA: Javascript / Jquery - Means to remove the contents of a <TD>
From what I understand you just want to know how to delete any element of the DOM. Well, being elemento the element you want to remove, it is possible to do the following…
-
4
votes1
answer922
viewsA: Laravel - Popular a list with files in a directory
That’s because by putting something between {{ }}, Laravel will try to make an escape from whatever is there and only possible escape strings. In this case, the content of $arrayRemessa[$i] is a…
-
4
votes1
answer9327
viewsA: as a tool to resolve Undefined Property: stdClass error:
It is impossible to extract id and nome of query. This is because only columns were specified in select email and senha. You need to alter the select or choose the fields correctly. THINK that you…
-
0
votes1
answer86
viewsA: Error sending a route to the same api/Controller/Action in a Webapi
You need to name the route, the CreatedAtRoute search for a route by name and not by "template" hers. [HttpGet("BuscarPorId/{id}", Name = "NomeDaRota")] public IActionResult BuscarPorId(int id) { }…
-
3
votes3
answers845
viewsA: How to declare a constant in Ruby?
Ruby doesn’t have constants "really". Like @Maniero said in his reply, it is possible to use the convention to write the variable name with the first uppercase letter. This will cause the…
-
3
votes1
answer594
viewsA: Is there any way to put Scroll on TBODY?
Can use overflow-y: auto and overflow-x: hidden. thead, tbody { display: block; } tbody { height: 100px; overflow-y: auto; /* Scroll vertical */ overflow-x: hidden; /* Desativar scroll horizontal */…
-
10
votes1
answer5685
viewsA: How to unlink local directory from remote repository?
You can: Delete the machine directory. Then the computer will no longer have the source code and consequently it will be impossible to make any changes. Remove the remote of the local repository.…
-
3
votes5
answers1186
viewsA: How to use the reduce (reduce) operation on objects?
It is necessary, first of all, to understand that in function reduce the return of each execution/iteration will be used as the first parameter in the next iteration. In the question code a number…
-
3
votes1
answer151
viewsA: Entity Framework 6: Error getting SQL Server record
Entity Framework requires a constructor with no parameters in models. public class Cliente { public Cliente() { } }
-
11
votes1
answer136
viewsA: Is it possible to convert an Arraylist<Double> to Arraylist<Integer>?
You need to do something so that all items from the original list return its integer value. This can be done with the method intValue(). Note that obviously the decimal part of the numbers will be…
-
19
votes2
answers31808
viewsA: The difference between COALESCE and NVL
The function NVL is specific to Oracle and only accepts two expressions as input. If the first expression is null, the function will return the second expression. Otherwise, the first expression…
-
10
votes3
answers8997
viewsA: Like saving and getting out on VIM?
To get out of the way you need to use :q in command mode. To save is :w. So to get out and save is :wq. If you do not know if you are in command mode or insertion mode, you can go "straight" to the…
-
2
votes1
answer187
viewsA: How to separate a string in Unity c#
What happens is that Unity runs on a very old version of Mono. And in this version, some things that we are used to are not implemented. The method Split, in this version, there is no overload that…
-
3
votes1
answer29
viewsA: How to view through breakpoint what values have been passed to my method?
Just put a stop sign (breakpoint) in the method and hover over the parameters. Or put variables in the window watch…
-
2
votes1
answer6168
viewsA: Error in Webservices Json C# "Unexpected Character encountered while Parsing value: <. Path '', line 0, position 0."
Webservice returned an HTML page specifying an error. Notice the tag title in Response.Content Jboss Web/7.0.10.Final - Error Report The code tries to treat the return as a JSON, but it is an HTML,…
-
2
votes1
answer131
viewsA: Executesqlcommand - Update byte - Error
You should use darlings parameterized to do this job. Anyway, you can do it this way: var valor = "0x" + BitConverter.ToString(arraytoinsert).Replace("-", ""); int num =…
-
4
votes3
answers588
viewsA: hiding component input when selecting a value in the select field
As you are using Angularjs, just create a rule using a directive ng-show. You know that the selected country ID will be saved in pessoasEnderecos.pais.idPais, from there it’s just do…
-
1
votes1
answer299
viewsA: Error: Multiple controller types Were found that match the URL
Prefix one of the routes (or both) with a unique name. For example: [Route("Negar/{id}/{value}")] public void AtualizaNegarLiberacao(int id, string value) { }
-
2
votes1
answer58
viewsA: Show fields of an entity in a different View
As you are using Entity Framework, this is quite simple to do. You can use the navigation property Professor that exists in Academico. To show, you can do the following on view: <div…
-
3
votes1
answer877
viewsA: jQuery does not recognize event . click of a class added with append
You need to register the event this way $(document).click('.excluirUpload', function(){ ... }); This is because your code runs whenever the page is fully loaded (ready) and after having the elements…
-
6
votes2
answers5974
viewsA: How to use ALIASES in Oracle correctly?
Names need to be in double quotes, not simple. SELECT MAX(salary) as "Maximo Salário" , MIN(salary) as "Minimo Salário", SUM(salary) as "Soma de Todos Salários", AVG(salary) as "Média Salarial" FROM…
-
1
votes2
answers174
viewsA: Checkbox show/Hide button for generated lines
There are many ways to do this. My tip is to use an attribute data-target in checkboxes and do with this attribute always contain the id of the element that needs to be shown or hidden. Also, make…
-
1
votes1
answer250
viewsA: Angularjs - ng-repeat is not working
There are two mistakes there: The list that should contain the $scope.series is out of of div containing the Directive ne-controller. In function adicionaSerie has the following line:…
-
3
votes1
answer660
viewsA: How to convert an object vector to another object?
It’s easy, just use one map() var result = arr.map((item) => new ObjetoB(item.aId, item.aNome)); Full Code - I used constructors in the classes for easy reading. class ObjetoA {…
typescriptanswered Jéf Bueno 67,331 -
6
votes2
answers260
viewsA: What is the difference between Cssclass="example" and class="example"
In practice there is no difference. CssClass is a property of controls web of ASP.NET - widely used in projects Webforms, I’m not sure there’s another case where they’re used. He’s just a wrapper…
-
0
votes1
answer65
viewsA: Fill input2 from input1?
The first thing you need to do is adapt the function autoCompleteCliente to return - in addition to idClientes and nomeCliente - the field parceiros_id. public function autoCompleteCliente($q){…
-
5
votes3
answers828
viewsA: Separate typed words within an input
First thing you need to know is that there is no Javascript to jQuery conversion, jQuery is Javascript, then all you write in jQuery var "turn pure Javascript code". What you can do is adapt your…
-
1
votes1
answer190
viewsA: Doubt Join with paginate Adjustable
Turns out inside this if if (request()->has('servidor')){ } You materialize the data with a ->get(). This makes the query is executed in the database and the data is brought to memory. Just…
-
2
votes1
answer109
viewsA: textbox value for another textbo using Tabcontrol and Tabpages
Just use the event Selecting of TabControl public void tabControl1_Selecting(object sender, TabControlCancelEventArgs e) { txtDois.Text = txt_vendedor.Text; // Onde, txtDois é o TextBox que vai…
-
6
votes1
answer447
viewsA: Asp.net Identity Decrypt
Not. Identity passwords go through a hash, which is a way to "shuffle" the information in only one way, ie, once the information has gone through this process, there is no way to get the original…
-
1
votes1
answer288
viewsA: Is it possible to define an HTML tag in a C#string?
You need to use the helper Html.Raw() @Html.Raw(mensagemErro.Descricao) See working on . NET Fiddle.…
-
2
votes1
answer210
viewsA: Get part of a string with Regular Expression - C#
Would that be var match = Regex.Match(str, @"(\d{3}-\d{5}-\d{4})"); The \d captures any digit, the number between keys tells the number of digits that must be captured and the dash is a literal, ie…
-
6
votes2
answers376
viewsA: Is it possible to concatenate a jQuery selector with a variable?
Yes, using the concatenation operator (+). $('a[href="#tab_0' + indice_da_aba + '"]').tab('show'); But for that, you need to have a value on each side of the operator. In the code shown, you even…
-
1
votes1
answer120
viewsA: Orange Error: [Reflectionexception] Class App Units Commands Inspire does not exist
The class Inspire only serves as an example to provide test commands. Remove it from the array $commands protected $commands = [ \App\Console\Commands\EnvioEmailBICron::class ];…
-
4
votes1
answer2558
viewsQ: How to select text columns in the editor?
I am editing some files with VS Code and need to select an entire column of file. For example: Insert Into Tabela (Data, Nome) Values (2017-07-05, 'Huginho') (2017-08-08, 'Zezinho') (2017-11-25,…
visual-studio-codeasked Jéf Bueno 67,331 -
4
votes3
answers1279
viewsA: How do I view the JSON of the API?
You are receiving an error with HTTP code 405. This error code is described: Method not allowed That is, you are requesting a valid resource, but with a method that the server cannot respond to. By…
-
3
votes1
answer931
viewsA: Composite Key Table without repetition
In this specific case, it is possible to create a Primary key composed. CREATE TABLE tb_amizades ( id_usuario_um INT NOT NULL, id_usuario_dois INT NOT NULL, CONSTRAINT…
-
1
votes1
answer347
viewsA: Does load method have beforeSend?
Not. The method jQuery.load(), as well as the jQuery.get(), is a simplification of jQuery.ajax(). What happens in the case of load() is that the server response will be inserted into the element…
-
2
votes1
answer745
viewsA: Instantiate a class from its string name
This can be done using Activator.CreateInstance. Usually there is no real need to work with this, so it is good to analyze the problem well and rethink about the use of this mechanism. The code…
-
3
votes3
answers1234
viewsA: My String is giving error "unicodeescape"
The problem is with the string 'C:\Users\Cintia\Documents\Python\Dados\lbe.txt'. \U begins an 8-character Unicode escape and, as is succeeded by s, which is an invalid sequence, bursts the error.…
-
5
votes2
answers61
viewsA: Why do even numbers not have the same output as odd numbers?
Just remove the line System.out.println(" "); Why do you print an empty row after each even number if (par%2 == 0) { System . out . printf ("%3d",par); System.out.println(" "); // <-------- }…