Posts by Tobias Mesquita • 22,900 points
750 posts
-
0
votes3
answers118
viewsA: Code repetition in the same method
you can try it as follows: private void CriaPastaFarmInterna(string oldPath, string newPath) { var oldDirectory = new DirectoryInfo(oldPath); var newDirectory = new DirectoryInfo(newPath); if…
c#answered Tobias Mesquita 22,900 -
3
votes1
answer55
viewsA: Validate form data with registration in the database
Pedrof, though lavishly discounting his choice of architecture (Entity Framework with Repository Pattern/DAL ), I will try to help you with the validation. First, make your entity, in case Player…
-
0
votes2
answers425
viewsA: How do I get a json answer in javascript/jquery?
Thiago, it seems a little strange to pass a json as a string to an API, especially by GET. but you can consume this URL in two ways: AJAX or JSONP: AJAX var json = { "login":"[email protected]",…
-
1
votes1
answer122
viewsA: Creating String Paging with Javascript
Diego, I believe this information comes from a file, possibly one similar to this: |A|Titulo 01|Descrição 01| |B|Titulo 02|Descrição 02| |C|Titulo 03|Descrição 03| |D|Titulo 04|Descrição 04|…
-
0
votes1
answer78
viewsA: How to create more organized codes?
Adriano, in your example above, you are trying to develop a Wizard. Regardless of the number of steps or business rules, we have a basic and common structure to this type of component. So for the…
jqueryanswered Tobias Mesquita 22,900 -
2
votes2
answers91
viewsA: Erasing bottom lines up
you can use lastChild.: var linha = document.getElementById("linha"); var remover = document.getElementById("remover"); for (var i = 0; i < 60; i++) { var span = document.createElement("div");…
-
0
votes2
answers40
viewsA: Order of operation of scripts
As pointed out by Peter, you must validate all fields before making the return. in any case, I advise you to also reuse the code that checks if the field is filled. var nome = { input:…
javascriptanswered Tobias Mesquita 22,900 -
2
votes1
answer271
viewsA: Javascript table to fetch data
you need to store the value of the destination somewhere, for such advise you to use custom attributes (a.ka.. data-*) <select name="destino"> <option /> <option data-custo-ini="2000"…
-
14
votes4
answers845
viewsA: Is it possible to access an object within itself?
code, you can do as follows: var Cadastro = function (descricao, editando) { this.descricao = descricao; this.editando = editando; }; Object.defineProperty(Cadastro.prototype, "titulo", { get:…
-
0
votes2
answers715
viewsA: Get information from the url
First, I believe your URL is misshapen, you should start your queryString with the character ?, then we have the following URL:…
-
3
votes2
answers234
viewsA: Pass menu from "normal" to "hamburger"
your first step, is to define the structure of your layout, for example: <div id="container"> <header> </header> <nav> </nav> <main> </main> </div> in…
-
1
votes2
answers2820
viewsA: How to generate an array using Random to assign values, but make it never repeat values?
you can use an auxiliary array with all available values.: public static int[] CriarLista(int min, int max) { var lista = new int[max - min + 1]; for (var valor = min; valor <= max; valor++)…
-
1
votes1
answer1418
viewsA: How to check if JSON has this structure?
Guilherme, if you want to validate the structure of a JSON, I advise you to assemble a JSON Schema for the same, you can read more about: JSON Schema On the site above you have a list of libraries…
-
4
votes2
answers3351
viewsA: How do I create a Checkbox using the Html.Checkboxfor Helper for a Nullable field?
Yuri, the CheckBoxFor wait a bool, this pq o checked has only two states, selected or not. optionally you can use the HtmlHelper.CheckBox and enter the property name as string.…
-
2
votes2
answers245
viewsA: How to toggle between List and Gallery
Diego, define the elements that will be displayed in each group, in the example below I called the group of card and each card has a imagem, titulo and desc. then set the space where the card will…
-
1
votes1
answer186
viewsA: transition between main container to a new Javascript container using DOM
Renata, follow the full example, as I said in the comments, the document.importNode does not make use of innerHTML, you will be creating and manipulating DOM objects directly, unlike innerHTML,…
-
3
votes1
answer99
viewsA: Javascript verification
Guilherme, any and all validation on the client side is ineffective to ensure the integrity of your data. However, they are important, as their use makes your page more user friendly and reduces the…
javascriptanswered Tobias Mesquita 22,900 -
2
votes1
answer533
viewsA: view HTML element placed on the page using DOM - Javascript
Renata, I advise you to define a template for the Console, and a Floor Template. document.addEventListener('readystatechange', function () { if (document.readyState == "interactive") { // todos os…
-
2
votes4
answers8648
viewsA: Remove space and break string lines
Dorathoto, I believe that better than removing spaces from the string, is to compress the entire Response. The easiest way to do it without configuring it directly on IIS is to install the following…
-
1
votes1
answer496
viewsA: Map class with json.net
Vinicius, as an alternative, you can use the Attributo [DataContract]and [DataMember] in place of [JsonObject] and [JsonProperty] respectively. But in doing so, you’ll have to put [DataMember] in…
-
0
votes2
answers169
viewsA: C# ASP.NET - Get last value from a Stored Procedure Parameter
Kawaii, if you want the value of @ult_nr, you will need to mark it as an exit parameter. including think it is not necessary, you could use own @numero. Then modify your process to the following:…
-
3
votes4
answers325
viewsA: Loop 20 to 20 lines
fromInclusive (initialization) and toExclusive (condition) must come from somewhere. for example, two text boxes.: var fromInclusive = document.getElementById("fromInclusive"); var toExclusive =…
-
5
votes3
answers2266
viewsA: Entity Framework [Foreignkey]
Matheus, I believe you’re not taking one thing into account: LazyLoad. Defido to Lazyload, to fetch one Student, only the data of Student are recovered from the Bank, only if you come to access the…
-
4
votes2
answers10008
viewsA: Add a value to a JSON object
you can add a property to the object obj with the values of a and b, but note that in doing so, you will be assigning a copy of the value, so modifications to the variable will not be reflected in…
-
2
votes1
answer974
viewsA: What is the [Httpget] statement for?
Wallace, the [HttpGet] and the [Length] sane Attributes, which are how to implement the Decorator Pattern in the .NET. They are useful when you want to associate some additional information to your…
-
1
votes3
answers4632
viewsA: Sqlserver Select in XML field
Hey, Varaujo, I went around here and it worked. if you need to apply some filter to your query, I advise you to turn the query suggested by Marconi into a CTE or create a View for it. declare…
sql-server-2012answered Tobias Mesquita 22,900 -
3
votes2
answers2566
viewsA: Login with Windows Authentication on IIS
you must first configure your IIS to perform authentication using Windows Authetication. To do it in the development environment, open the visual studio, right-click the Mouse on the Project, choose…
-
1
votes1
answer44
viewsA: What Dlls do I need to create an oracle project in visual studio 2015?
You have not mentioned whether you want to work with ADO.NET or Entity Framework. In any case, I advise you to work with EF6 Code First, for this just install the following NuGet: Official Oracle…
asp.netanswered Tobias Mesquita 22,900 -
2
votes1
answer393
viewsA: Fill Select Automatically via If and Else with Jquery
do as follows: var data = { uf: 'SP' }; var estado = $("#estado"); var select = $("#selecione-estado"); var option = $("option[data-sigla='" + data.uf + "']"); estado.val(data.uf);…
jqueryanswered Tobias Mesquita 22,900 -
0
votes2
answers339
viewsA: How to use Highlight <button onclick=...>
you can’t apply a style :visited is an element of the type button. What you can do, is create a class in css to style a button.admenus1 that has already been clicked. Then you should store in…
javascriptanswered Tobias Mesquita 22,900 -
0
votes2
answers1179
viewsA: Mysql - Recursive query to get only parent categories
gugoan, as I said in the comment, if Mysql would support CTE, the query would be much simpler, in any case I would like that in your next question about SQL, you prepare a Sqlfiddle like this:…
mysqlanswered Tobias Mesquita 22,900 -
9
votes1
answer120
viewsQ: Differences between readonly Func<> and method
Forgetting a little questions like readability, what would be the differences between the following calls? readonly Func = (T1, T2) => { Return default(Tresult); } private readonly Func<int,…
-
1
votes4
answers135
viewsA: How does object copying work?
I know you have your explanation, but I’d like to mention Object.assign, which serves precisely to merge objects: var a = { a: 1, b: 2, c: 3 }; var b = Object.assign({}, a); b.a = 4; console.log(a,…
-
1
votes3
answers688
viewsA: Select with various Procedures
Codornex, we usually use functions when we want to return some data to be used in a DDL Script, due to this nature a function cannot insert, update, or erase data. If your trial does not modify any…
sql-serveranswered Tobias Mesquita 22,900 -
1
votes2
answers433
viewsA: Deserialize array in Json
you can write your own Jsonconverter to handle this object, this way you will be able to map the array’s input in JSON to an Object and vice versa. using System; using Newtonsoft.Json; using…
-
1
votes1
answer165
viewsQ: Webapi problem when trying to Deserialize object with property of the same type (circular reference)
I’m doing some tests with WebAPI, to see how it behaves with circular reference, and found a curious case. Model [DataContract(IsReference = true)] public class Pessoa { [DataMember(EmitDefaultValue…
-
2
votes2
answers70
viewsA: Set click event to an element that was inserted via AJAX, after page loading
click is with the mouse, touch finger, keydown with the keyboard... after all you can not click with the keyboard or type with the mouse. $(elementoPai).on('click keydown', 'elementoFilho',…
-
3
votes1
answer4186
viewsA: XML with Javascript
you can make a request AJAX to read the XML, once it is loaded, you can navigate it in the same way as you navigate through the elements DOM of your page, using getElementById, getElementsByTagName,…
-
0
votes1
answer658
viewsA: Local Application to Save C#Data
by your comment, you are confused not having a database with having an embedded database. for example, you can create an installer with Installshield who installs the SQL Server Express Localdb (MSI…
-
1
votes2
answers647
viewsA: Popular an object array with a string
Warlock, I see that you are working with a text file, where the separation of the columns is made by the size of the string. in this case you will need to break the file into lines, using the…
-
4
votes4
answers1189
viewsA: How does a search engine work?
Randrade, to accomplish this work, you will need two tools, a Crawler (a robot that scans (crawls) the internet for information) and an Indexer (it is that will organize and catalog the information…
-
2
votes1
answer141
viewsA: Decrease the Elements feature in the DOM applied in the Jquery that generates Ripple
you can do the same effect only with CSS, maybe solve your memory problem. var riples = document.querySelectorAll(".riple"); function onStep1End(event) {…
jqueryanswered Tobias Mesquita 22,900 -
1
votes2
answers356
viewsA: Exception with timestamp in the database
Kawaii, if Esat using MSSQL and wants to store a date and time in different fields, I advise you to change the field type to date and time respectively. In any case, for new banks, it is advisable…
-
3
votes4
answers31555
viewsA: Remove special characters and accents in javascript
unfortunately there is no simple regular expression that handles the special characters, your best option here is to map the same. In another question, I’ve already entered the merits of how to map…
-
1
votes1
answer119
viewsA: How to delete record from 2 tables where one contains the left 0 SQL SERVER
as I don’t know what kind of data you have in this field, it can be a string that has only numeric characters or not. Then you can use substring to remove the zeros on the left, for example: DECLARE…
-
1
votes2
answers3467
viewsA: How to edit HTML table data with jquery
First, the method of .bind('evento', callback) is decrecated, use the .on('evento', callback). Second point, how are you not setting a scope for your selector every time you make a…
-
0
votes1
answer101
viewsA: Insert apostrophes with variables
to escape the ', use two apostrophes: SELECT * FROM anaProdutos WHERE cod_produto LIKE '''' + @it_codigo + ''''
-
1
votes2
answers246
viewsA: How to overwrite a page with ajax
Asura, it is possible yes, including this is the principle of the SPA. if you have a small number of pages, it may be interesting for you to load all the necessary scripts for the pages. Let’s look…
-
0
votes1
answer332
viewsA: Join several values of type Iqueryable
you don’t need the +=, the method Where() already returns a IQueryable. catequizandosPorDiasDisponiveis = catequizandosPorDiasDisponiveis.Where(d => d.Dispo.Contains(dia)); in any case, this loop…
-
1
votes3
answers166
viewsA: Fix name in search field
I couldn’t see your example, but you can use Indexeddb. for this you can store your filter in Indexeddb with the following format: { id: "<inteiro auto-incremental>" timeA: "<nome do time…