Posts by Thiago Lunardi • 6,968 points
255 posts
-
1
votes1
answer220
viewsA: Filling a Listbox with data from checkboxes
I made a very simple POC, I hope it helps: HTML: <input type="checkbox" value="1" /> Um <input type="checkbox" value="2" /> Dois <input type="checkbox" value="3" /> Tres <ul…
-
0
votes2
answers59
viewsA: What version of the Mysql connector in Azure?
Azure cloud provider does not have preset connector settings. Every connector you need to use, you should go up along with your web design. That is, if you need a Mysql Connector, just embed it in…
-
1
votes1
answer51
viewsA: Use the same disk for 2 Vms in Azure
You can’t do it, at least not like this. Attaching a disk to a VM is like connecting that disk to the machine’s SATA input, there is no way to share it. What you can do is: Create a 3rd VM, attach a…
-
3
votes2
answers334
viewsA: How to protect an Assembly from decompilation?
The best way to protect your code is OVERSHADOWING. Here owns a List of Obfuscators for . NET. Obfuscation is the process of modifying an Assembly so that already is no longer useful to a hacker,…
-
0
votes2
answers523
viewsA: Compare two fields between different tables
Using the @Nilsonuehara query, only to "list the number of records found" SELECT imoveis.id, imoveis.vvenda, count(*) total FROM imoveis LEFT JOIN clientes ON clientes.cliente = imoveis.cod WHERE…
-
-4
votes2
answers2701
viewsA: Which is more secure: Session or cookie?
Use ASPNET Identity to manage your users' authentication. It already predicts several security issues and is super easy to work with. The ideal is to use a cookie to record non-safety information.…
-
9
votes6
answers502
viewsA: Empty semicolon doesn’t make a mistake?
The compiler of C# - Roslyn, in the most current version - has "intelligence" to supply these situations. Multiple semicolons: return; ; ; => return; String concatenation: string a = "b" + "c";…
-
3
votes2
answers244
viewsA: What is the best way to publish my C# Asp.NET application on Azure?
Only supplemented by @Gypsy’s reply. Actually, by default, the Webdeploy method does not erase old files, but there is a simple, simple configuration. In the "Publish Web" window, in the "Settings"…
-
1
votes2
answers297
viewsA: How to get checkbox and option value with jquery
To get selected values from a <select>: $('select option:selected').each(function(){ resultado = resultado +'|' + this.value; }); See the Jsfiddler working.…
-
3
votes1
answer2460
viewsA: Function in Mysql for sending EMAIL
In this answer has explaining how to do this: https://stackoverflow.com/a/4101782/2520523 But this is strongly discouraged. Sending emails is not the responsibility of the database. This will be…
-
1
votes3
answers392
viewsA: Asp Net MVC pass connection string to access layer
Just add the Connectionstrings to your web.config. List only the names of the connections on the login screen. Then you can persist the name selected in a Session, and in the other layers you refer…
asp.net-mvcanswered Thiago Lunardi 6,968 -
4
votes1
answer120
viewsA: Are methods and builders the same?
Yes, builders are methods. And it can be said that they are "special", for they can only be called in the instance of a class. You can apply the same security access, such as public, private,…
-
0
votes3
answers113
viewsA: Is it possible to create predefined css values?
Yes, but not directly in CSS. You must implement {LESS} or Saas to get. These technologies support you to create variables and logics where these generate a css from predefined values.…
cssanswered Thiago Lunardi 6,968 -
-1
votes2
answers115
viewsA: Change in json File Format
There is a widely used method which is the use of Viewmodels. You create a Viewmodel for each custom return of your API actions. Ex: public class VendaViewModel { public int Id { get; set; } public…
-
1
votes1
answer90
viewsA: Is it possible to create a data field that is Cross-Browser?
Not all browser supports <input type="date" />. See here the browser compatibility list for the tag <input type="date">…
-
0
votes3
answers1931
viewsA: Breaking Bootstrap Columns
I see 3 situations in your HTML: 1) The sum of the columns of the first "layer" of columns is less than 12. <div class="container"> <div class="row"> <!-- a primeira poderia ser…
-
5
votes2
answers991
viewsA: How to make the first 4 characters of a string smaller than the others
I think you can handle it this way: $numero = '1234567890'; echo '<small>'.substr($numero, 0, 4).'</small>'.substr($numero, 5); Using substr I separated the string into 2 parts, one with…
-
-1
votes1
answer164
viewsA: Open div by clicking on specific element
If you can, use the Bootstrap Small Modal. It is elegant, and very simple to implement.
-
7
votes1
answer398
viewsA: Relationship 0.. 1 in practice
If a field is a foreign key, and at the same time can receive a null value, then it does not have to have value. However, if it has value, it must refer to the referenced table. So, the way you…
-
0
votes1
answer151
viewsA: Insert mysql with Ajax inside While
The problem is in replicating field ID, this cannot occur. See that inside your while vc replicates the property ID of your input. Instead of doing this, put one ID per line like this: <% while…
-
1
votes1
answer123
viewsA: Does anyone know how to enable PDF export functionality in Datatables
Excerpt from the documentation of Tabletools of Datatables.net. /* * Example initialisation */ $(document).ready( function () { $('#example').dataTable( { "dom": 'T<"clear">lfrtip',…
-
1
votes2
answers1278
viewsA: Capture selected Dropdownlist item
The case is that, at the dropdownlist click, the selected value is still zero, for its value has not yet been changed. Use the event SelectedIndexChanged(), this will be triggered after the…
-
1
votes4
answers144
viewsA: Problems initializing a type within a LINQ query
You cannot initialize an object within a Linq expression. Simple like this. But there’s a way around: public class ForumDTO { // Propriedades public static ToForumDTO(Forum f) { return new ForumDTO…
-
3
votes2
answers192
viewsA: In MVC, if I have utility classes, will they be part of the models?
Is not cool these utility classes. In your case, create a folder called Extensions and then create a class StringExtensions and within it put all methods that are to treat strings. Example, if you…
mvcanswered Thiago Lunardi 6,968 -
0
votes1
answer123
viewsA: How to transfer selected checkboxes to an Hidden input field?
If I can use jQuery, it’s something like this: $('.classDosCheckBox').click(function () { var $hidden = $('#idDoInputHidden'); if(this.checked) $hidden.val($hidden.val() + ',' + this.value); else {…
-
2
votes1
answer368
viewsA: Error using JSON with datatable
Follow Jsfiddle with the answer: https://jsfiddle.net/o3b8tf32/1/ Missed the <tr> in the <thead> in the table statement: <table class="table table-bordered"> <thead>…
ajaxanswered Thiago Lunardi 6,968 -
1
votes2
answers136
viewsA: Complex type bind with Angularjs
You need to adjust your Viewmodel to receive the same structure that is coming from your post request. public class PessoaViewModel { public int PessoaFisicaID { get; set; } public string Nome {…
-
1
votes3
answers910
viewsA: Field CPF, CNPJ and Other Document - jQuery validation
You will only be able to do this when the courses leave the field, before that there is no way you can predict what will be inserted: CPF, CNPJ or Other Document. I’d go like this: In the onblur -…
jqueryanswered Thiago Lunardi 6,968 -
2
votes4
answers1314
viewsA: Check checkbox with ajax
I would do something like this: <input type="checkbox" id="idDoCheckbox" data-id="idDoVeiculo" /> $(function() { $("#idDoCheckBox").click(function() { startLoader(); var checked =…
-
1
votes6
answers10207
viewsA: Open Multiple Bootstrap Modals
I was able to do this by creating containers for each modal, each with a different z-index, so one modal could overlap the other. <div id="modalContainer"><!-- seu primeiro modal aqui…
-
1
votes4
answers1821
viewsA: String and variable concatenation problem in jquery load function
To redeem values from <select> in jQuery, it is done so: var estado = $('#estados option:selected').attr('value'); For the object <select> has no value, it has several options, and you…
-
1
votes2
answers62
viewsA: co-pilots who made the most flights
To know total flights (cycles): SELECT TMP.* FROM (SELECT T.Id, T.Nome, Count(*) Voos FROM Tripulante T JOIN Voo V ON V.Id_CoPiloto = T.Id GROUP BY T.Id, T.Nome) TMP ORDER BY TMP.Voos DESC To know…
sqlanswered Thiago Lunardi 6,968 -
0
votes3
answers1534
viewsA: Create global function in Angularjs?
That shouldn’t work, because $mdToast will be out of context. I think it’s ideal that you create an abstract base class, and then your controller extends that base. And in this abstraction you…
-
1
votes2
answers1173
viewsA: How to use folder to store images in a Web Api project published in Windows Azure?
As a Software Architect, I’d like to share. No files hosted on application servers This is bad practice, and should be avoided to the extreme. There are specific services for data mass persistence,…
-
2
votes3
answers517
viewsA: Create FTP access to a virtual directory on Azure
Daniel, The Azure Webapp service does support publishing via FTP, but it gives you access to the entire publishing area and has no support for specifying access to a specific folder. What is…
-
1
votes1
answer102
viewsA: I installed IONIC, but I have no idea how to make PHP work
PHP vc will make a backend to respond to IONIC. Your Ionic app will consume this backend (typically REST API) through asynchronous calls - AJAX. What you have to do is study how to create a REST API…
-
2
votes2
answers384
viewsA: Validation of Image Size
I use the jQuery Fileupload to do this. Natively it already has this validation, and some other cool features. $('#fileupload').fileupload({ acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i, // tipo de…
-
3
votes2
answers514
viewsA: C# how to do database search using parameters
As soon as you consult with Parameters and LIKE clause. var cmd = new SqlCommand("SELECT * FROM tbEspecialidades WHERE NomeEspecialidade LIKE '%'+ @NomePesquisado +'%'", connection);…
-
0
votes2
answers6834
viewsA: Bootstrap 3 | Column height on Grid System
Lucas, I’ve been there, and I’ve been there: I created a custom class: /* substitua 200px pela altura do quadro com duas linhas, "MELHOR" */ .min-height-200 { min-height: 200px; } So, in every frame…
-
-1
votes3
answers63
viewsA: Characters " ' " and " f " appear in the textbox, how to correct?
In Javascript that 'false' with single quotation marks or "false" are strings, and every string is FALSE. $(".input-numeric").numeric({ decimal: false, negative:false }); Here is some very didactic…
-
1
votes3
answers1301
viewsA: Move folder/files between repositories without losing Change history
I don’t use Tortoise, but I use GIT and VSTS and I’ve been through something similar. I decided to create a new Branch of the project in a different path, and this new Branch became the main one. So…
-
2
votes3
answers177
viewsA: Create a table with dates
Ah! You want the first column to be MONDAY, is that it? Forehead: var diaDaSemana = (int) dia.DayOfWeek; var inicioDaSemana = dia.AddDays(diaDaSemana-1); for (int dias = 1; dias < 7; dias++) {…
-
0
votes3
answers1124
viewsA: Javascript Access Modifiers
Let’s see if I can help. The above understanding is correct? Yes, that is correct. Because t does not have access to t.b, just as p does not have access to p.d? Pq x.b is static, and after you…
-
1
votes1
answer480
viewsA: Recover Mysql data and save to a vector
@G.Vilela You’ve got 90% of the way, so it’s easy. IMPORTANT: I’m not a PHP programmer. BACKEND - REST API Instead of making a PHP to answer everything conecta.php, create a more expensive API…
-
1
votes4
answers16671
viewsA: Synchronous Xmlhttprequest error on the main thread is deprecated
@Rodrigosegatto DOM handlers on newer versions of browsers are no longer supporting synchronous calls. That’s exactly what he’s returning to you. Certainly, the jQuery 1.8 library should still use…
-
-2
votes1
answer47
viewsA: Every time I upload files I get a large amount of errors
Everything indicates that the "Sample" you are trying to open was done in ASPNET 4 MVC 5, and you are creating an ASPNET 5 MVC 6 project. Create a new project, but as ASPNET MVC 5 (not ASPNET 5 or…
-
12
votes3
answers5035
viewsA: When to use Sqlite?
Sqlite vc uses if you need to have a data scenario in disconnected mode. Example: You have your corporate system (15 tables with 1000 records each), but need to go to the field (disconnected…
-
0
votes1
answer180
viewsA: Does Regular Expression vary according to language?
NAY It does not vary, what happens is that it is always in development, and there is a gap between the publication of a new resource and the libraries of various languages support them. However, an…
-
3
votes3
answers5377
viewsA: SELECT IN A RELATIONSHIP WITH SELF RELATIONSHIP(Verifying Conflicts)
You can do it with LEFT JOIN more DISTINCT SELECT DISTINCT D.NomeD FROM Disciplina D LEFT JOIN Disciplina DPai ON DPai.PreReqD = D.CodD WHERE D.PreReqD IS NULL AND DPai.CodD IS NULL UPDATE: Selects…
-
5
votes3
answers1244
viewsA: How to make a NOT IN SQL?
@Esteves, use the IN clause with subquery with great caution, because it is very expensive its processing. Understand that for each record of each SQL relationship table, it will run once the…
sqlanswered Thiago Lunardi 6,968