Posts by PauloHDSousa • 3,509 points
159 posts
-
2
votes1
answer54
viewsA: Problem comparing boleano value from javascript
Hello, the problem is that you are not counting what is different from number and letter, as for example special character <!DOCTYPE html> <html> <head> <script…
-
1
votes2
answers73
viewsA: Two functions in the same javascript onclick event
You are making a redirect in the method vistoriaIniciar() window.location='vistoriaIniciar.html?codigo='+aCodigo+'&ambiente='+aNome+'&id_ambiente='+aID; And is waiting 3 seconds to run…
javascriptanswered PauloHDSousa 3,509 -
-5
votes1
answer5325
viewsQ: Validate agency DV and federal savings account
I could not find any documentation that says which account should be made to validate the DV of the federal savings bank, someone knows which account should be made or where I find this information?…
algorithmasked PauloHDSousa 3,509 -
2
votes3
answers1421
viewsA: Compare if two date fields are equal in C#
using System; public class Example { public static void Main() { DateTime date1 = new DateTime(2009, 8, 1, 0, 0, 0); DateTime date2 = new DateTime(2009, 8, 1, 12, 0, 0); int result =…
-
0
votes0
answers72
viewsQ: How do I make a POST + Redirect with Angular?
Hello, I need to post to a page and redirect along with the post to when load the page display the posted data. The problem is that when I do the post it already brings me the RESPONSE with the…
-
1
votes1
answer4638
viewsA: Validate email input using Jquery.Maskedinput and/or Jquery
Try it this way $('#email').mask("A", { translation: { "A": { pattern: /[\w@\-.+]/, recursive: true } } });…
-
0
votes1
answer415
viewsA: Restart Your Phone
Put that permit on your manifesto <permission android:name="android.permission.REBOOT"/> Rotate that code PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);…
-
4
votes1
answer501
viewsA: How to hide items from a C# MVC template menu?
Do 2 methods like this public bool IsAdmin() { if (!IsAuthenticated()) return false; var user = User.Identity; ApplicationDbContext context = new ApplicationDbContext(); var UserManager = new…
c#answered PauloHDSousa 3,509 -
0
votes1
answer1036
viewsA: jQuery Mask does not work
Your problem is that you are calling the code $(document).ready(function(){ $('#cpf').mask('000.000.000-00'); }); before loading Jquery, just move these two lines to before executing the above code.…
jquery-mask-pluginanswered PauloHDSousa 3,509 -
1
votes1
answer274
viewsA: Margin problem when generating pdf
There is something in . css that is breaking in your PDF generation.
-
0
votes1
answer103
viewsA: Function does not work with Usesubmitbehavior="False"
Do so <asp:Button ID="Button11" runat="server" Text="Cancelar" CssClass="btn btn-danger btn-block" OnClick="Button11_Click" OnClientClick="if ( ! UserDeleteConfirmation()) return false;" />…
-
2
votes2
answers5067
viewsA: How do I get back to old versions in nodejs by npm?
Suffice sudo npm cache clean -f sudo npm install -g n sudo n x.x.x Where x.x.x is the version you want Source:https://www.abeautifulsite.net/how-to-upgrade-or-downgrade-nodejs-using-npm…
-
1
votes1
answer85
viewsA: How to enable/disable a txt from a choice of a jquery radiobutton?
$("#<%=rdbDados.ClientID%>").change(function () { $("#inatividade").prop("disabled", $("#rdbDados input:radio").is(':checked')); });
-
0
votes1
answer213
viewsA: How to clean Output Window from Visual Studio?
Source: https://stackoverflow.com/questions/25627384/how-to-programatically-clean-output-in-visual-studio-2013 // Import EnvDTE and EnvDTE80 into your project using EnvDTE; using EnvDTE80; protected…
-
1
votes4
answers110
viewsA: message : "div is not defined"
Simple, you’re with the div RUNAT=SERVER , soon the ID will change why this div wheel server side, try to catch by the class <span class="minha_div" id="minha_div" style="border: none"…
javascriptanswered PauloHDSousa 3,509 -
0
votes5
answers545
viewsA: Different format for display and return (bootstrap-datepicker)
Only use the format property $('input').datepicker({ format: 'dd/mm/yyyy' }); <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"…
-
3
votes1
answer265
viewsA: Numbers in Cpf (JS) format
You can use the Jquery Mask Plugin $(document).ready(function(){ $('.cpf').mask('000.000.000-00', {reverse: true}); }); https://igorescobar.github.io/jQuery-Mask-Plugin/ Example: $(function() {…
-
2
votes2
answers4075
viewsA: Java - method to check whether a String contains a certain character
I think that’s better public static boolean VerSeTemLetras (String qqString){ return qqString.contains("a") && qqString.contains("b") && qqString.contains("c"); }…
javaanswered PauloHDSousa 3,509 -
2
votes3
answers1667
viewsA: Show input when user selects option
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha256-k2WSCIexGzOj3Euiig+TlR8gA0EmPjuc79OEeY5L45g=" …
-
2
votes2
answers37
viewsA: To get a single element through the.filter array
let address = []; address.push({ formatted_address: "275-291 Bedford Ave, Brooklyn, NY 11211, USA", address_components: [{ long_name: 'long name', short_name: 'short…
javascriptanswered PauloHDSousa 3,509 -
0
votes1
answer238
viewsA: Create a filter using Jquery
Hello I believe it was a simple at the time to define the last object to give display None Forehead like this $("input[name='_3_keywords']").keyup(function() { var palavrasChave =…
-
0
votes2
answers167
viewsA: Instruction jQuery only works by console
Try it this way $(function(){ $.ajax({ url: addressWebService+'auditoriaexcecao/getAuditorias/audi_id/'+audi_id, type: 'get', dataType: 'json' }).done(function(r){ if(r.length >= 1){ var hora;…
-
-1
votes1
answer89
viewsQ: How to add properties in an Expandoobject()?
I was using the type Dynamic and I’ve been alerted that he has performance issues. How could I make the code below using ExpandoObject ? dynamic dObject = new ExpandoObject(); dObject.a= a; And how…
c#asked PauloHDSousa 3,509 -
0
votes1
answer31
viewsA: Javascript does not create cookie
Try to disable this option in your Chrome. Settings > Privacy > Content Settings and lets the settings match this image.…
javascriptanswered PauloHDSousa 3,509 -
5
votes2
answers2135
viewsA: Key code does not hold the ESC key
Try it like this $(document).keyup(function(e) { if (e.keyCode === 27) vm.fecha_modal(); });
-
0
votes2
answers446
viewsA: How to check for async processes running
I think this solves, create a Global variable named asyncRodando and in its async code put asyncRodando = true; // CÓDIGO ASYNC AQUI asyncRodando = false; And at closing time do something like. {…
-
2
votes1
answer53
viewsQ: In terms of performance, what is the best way to declare a variable that will be used in multiple Actions/Methods in a class?
Which mode is best performatically speaking? Which way you recommend and why? //Modo 1 MeuManager mm = new MeuManager(); JsonResponse MetodoDOIS(string urlImagem) { var abc = mm.Lista(); }…
-
0
votes1
answer260
viewsA: Save form data to cookie and popular form with this data after page re-load
To load select, do so. 1- Load select fields (all entries in select) $(function(){ $("#frachisees_filter").val($.cookie('frachiseesValue')); $("#schools_filter").val($.cookie('schoolsValue')); });…
-
6
votes3
answers146
viewsA: Performance "Where in foreach vs if"
The 1 code was faster (but I find it much uglier to read) Follow what I used to test using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics;…
-
1
votes2
answers700
viewsA: Dropdownlist quantity Items
I think this will solve your problem, if you want to show more items change the height of your item HEIGHT <style type="text/css"> .scrollable{ overflow: auto; width: 70px; height: 80px; /…
-
2
votes1
answer1171
viewsA: Change date format to Brazilian default, datepicker Jquery
Follow a solution, I just needed to change your . js $(document).ready(function() { $("#startDate").datepicker({ numberOfMonths: 1, dateFormat: "dd/mm/yy", onSelect: function(selected) {…
-
0
votes1
answer280
viewsA: Set <option> when checking/unchecking checkbox
Just do it like this $('#selSub').val('0'); Sources: https://stackoverflow.com/questions/13343566/set-select-option-selected-by-value http://api.jquery.com/val/…
-
1
votes1
answer393
viewsA: Pull fixed data from . json to select in form
Man, I don’t quite understand what you’re trying to do, but follow the code to list the neighborhoods of a city. <html> <script…
-
0
votes2
answers606
viewsA: How to remove all files from a folder?
I solved it in a similar way removeRecursively I got the idea thanks to my friend Ack Lay, thank you. window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onRequestFileSystem, fail); function…
-
2
votes2
answers606
viewsQ: How to remove all files from a folder?
I am trying to remove all files from a folder using Cordova and Android, the problem is that every code I think, only shows how to remove FILES and not FILES FROM A FOLDER. The problem is I don’t…
-
0
votes1
answer60
viewsQ: Do you have a problem with indexing on Google with dynamically loaded content pages?
I have a page today that is already in production and accessible to anyone by Google where your content is fully loaded from Server and rendered. I upgraded it and now your content will be loaded…
-
3
votes3
answers997
viewsA: aps.net C# Renaming an image name
Use the System.IO.File.Move System.IO.File.Move("nomeoriginal.jpg", "nomepretendido.jpg"); Source: https://stackoverflow.com/questions/3218910/rename-a-file-in-c-sharp…
-
20
votes1
answer422
viewsQ: Is replacing strings with Regex slower than Replace()?
Let’s say I want to do something like this question: How to convert Camelcase to snake_case in C#? You had some answers, but I want to highlight these two. Answer 1 string stringSnake =…
-
3
votes3
answers216
viewsA: What are the advantages of working with Fluent Interface with LINQ?
Take a look like this. private void Form1_load(object sender, EventsArgs e) { Empregados lista = new Empregados().Lista(); var consulta = lista.OrderBy(p => p.Nome).ToList();…
-
0
votes1
answer128
viewsA: Select html receiving value from a Javascript textbox
Try to change your method Mudavalddlcomtxt for something like this function MudaValDDLComTXT(){ var txtEmpIni = document.getElementById("EmpIni"); $("#EmpNomeIni").val(txtEmpIni.value); }…
javascriptanswered PauloHDSousa 3,509 -
3
votes4
answers6154
viewsA: How to get session cookie via javascript?
Use the plugin http://plugins.jquery.com/cookie/ Create $.cookie("exemplo", "abc"); $.cookie("exemplo", "abc", { expires: 7 }); $.cookie("exemplo", "abc", { path: '/admin', expires: 7 }); Read…
-
1
votes1
answer258
viewsA: Pre-select Last Record in a Dropdownlist c#
Do so for (int i = 0; i < empresa.Count; i++) { empresa[i].ParEmpresa = empresa[i].ParCodigo + " - " + empresa[i].ParEmpresa; } ddlEmpIni.DataSource = empresa; ddlEmpIni.DataTextField =…
-
2
votes5
answers98
viewsA: Conversion of object properties to numbers
Use the parseint method() var a = parseInt("237"); alert(a); Source: http://www.w3schools.com/jsref/jsref_parseint.asp…
-
1
votes1
answer1720
viewsA: Assign href via jquery
Hello, Put it like this. $(function() { /* Atribui ID */ $("#itemsA").attr("href", "@ViewBag.IDDisciplina"); /* CRIA A HREF */ $('<a>', { class: 'item dalink', href:…
-
1
votes1
answer81
viewsA: How to keep scrolling always at the end of the WPF textbox
I found this solution here textBox.VisibleChanged += (sender, e) => { if (textBox.Visible) { textBox.SelectionStart = textBox.TextLength; textBox.ScrollToCaret(); } }; Sources:…
-
0
votes2
answers351
viewsA: Change selected menu according to URL segment in Angular
Try to do this. <li class="waves-effect waves-light" ng-class="(url_atual == '/module9' || url_atual == '/module9/interna ou module9/slug' ? fundo_selecionado:fundo_normal)"> <img…
-
3
votes2
answers815
viewsA: How does the logic of Where in the Entity Framework work?
Come on Whenever I want to return a Where, I just do something equivalent inside this lambda by returning true or false to the data I want to return? A:Correct If I wanted users who didn’t have the…
-
1
votes1
answer232
viewsA: The Viewdata item that has the key 'officeId' is of type 'System.String' but must be of type 'Ienumerable<Selectlistitem>'
Hello, The problem is that you are trying to list a string. In this line. @Html.DropDownListFor(model => model.officeId,(SelectList)ViewBag.officeList, string.Empty, new { @class = "form-control"…
-
1
votes2
answers368
viewsA: Is the calculation of RENAVAN correct? Can you improve something?
Follow the slightly improved code public static bool isRENAVAM(string RENAVAM) { if (string.IsNullOrEmpty(RENAVAM.Trim())) return false; string SoNumero = Regex.Replace(RENAVAM, "[^0-9]",…
-
1
votes1
answer81
viewsA: Run something after an animation - WPF
Simply place a Handler signature on Completed before calling beginAnimation. public ConfigInicial_Empresa() { InitializeComponent(); brush = (Brush)bc.ConvertFrom("#444"); window.Background = brush;…