Posts by henriquedpereira • 4,415 points
97 posts
-
3
votes1
answer2517
viewsA: throw new Exception in PHP
Syntax is wrong, change line to: throw new Exception("Please update the module named 'motif' or enable the module named 'core'."); Source: http://php.net/manual/en/language.exceptions.php…
phpanswered henriquedpereira 4,415 -
1
votes1
answer92
viewsA: Error comparing two numbers
Cast the string to float using (float), thus: $valor_contas = (float) $row['SUM(valor)'];
phpanswered henriquedpereira 4,415 -
4
votes3
answers3209
viewsA: Chart JS - hide caption
You can disable using : Chart.defaults.global.legend.display = false; Source: Documentation…
-
0
votes1
answer56
viewsA: How to force a click on a highchart point?
Usa firePointEvent(type), take a look at this example : http://jsfiddle.net/7xEhW/31/
highchartsanswered henriquedpereira 4,415 -
2
votes3
answers392
viewsA: Asp Net MVC pass connection string to access layer
Another alternative to doing this is also using a hack to change the read-only parameter ConfigurationManager.ConnectionStrings, this solution found on the website http://david.gardiner.net.au/,…
asp.net-mvcanswered henriquedpereira 4,415 -
0
votes3
answers392
viewsQ: Asp Net MVC pass connection string to access layer
I am with a project that is divided in layers, BLL DAL and UI, in the UI is my MVC project, however arose the need that in the login screen the user choose the connection string, how can I pass this…
asp.net-mvcasked henriquedpereira 4,415 -
5
votes1
answer4598
viewsQ: Generate Danfe from Nfe XML
I’m developing an application ASP.NET MVC with C# and need to transform XML from NF-e to Danfe in PDF, someone knows some component to it?
-
11
votes2
answers34966
viewsA: What is the correct way to use the Location header?
In place of header["location: produto-lista.php"]; puts header("location: produto-lista.php"); die('Não ignore meu cabeçalho...'); The die() is important so that nothing runs after this command,…
-
-1
votes2
answers940
viewsA: how to make a cart items counter
Do it like this: <form target="pagseguro" method="post" action="https://pagseguro.uol.com.br/checkout/checkout.jhtml"> <input type="hidden" name="email_cobranca"…
phpanswered henriquedpereira 4,415 -
0
votes1
answer161
viewsA: Random words
I made a simple example in the fiddle, has things to improve but can already have an idea of how it can be done: https://jsfiddle.net/henriquedpereira/9c6t3h9d/ $('#meuCarousel').bind('slid',…
-
1
votes2
answers918
viewsA: Receive form name or Submit PHP
Picking up the form name is not possible. I find it easier to put a field Hidden, with the name of the form, then you take this field, or also get the name or value of the Submit button.
-
1
votes1
answer42
viewsA: Return a php query array
An easy way to do it is to turn the 11-line array into a string with the data separated by comma, then you just put the string in the json date, in php you do so: $suaArray =…
phpanswered henriquedpereira 4,415 -
1
votes3
answers1011
viewsA: Read a txt file by php and mysql and viewed by each user
I made a simple script to get the data of the text file in the format you sent, follows: <?php $handle = fopen("dados.txt", "r"); if ($handle) { $total = 0; while (($line = fgets($handle)) !==…
-
24
votes1
answer9723
viewsQ: What is Tuple and when to use?
I saw the use in a site and I was left with the doubt of what is Tuple, and when should I use in my project?
-
9
votes1
answer2403
viewsQ: What is Cultureinfo.Invariantculture?
I installed Resharper and on that stretch x.Id.ToString() he suggests changing to x.Id.ToString(CultureInfo.InvariantCulture). What is CultureInfo.InvariantCulture and why that way is better?…
-
1
votes2
answers336
viewsQ: Creation of ASP NET MVC reports
I need to create multiple reports on my system to display the data on the screen and have export options to Excel and PDF, where do I start? there’s some component that helps me with this?…
-
8
votes3
answers576
viewsQ: Session Limitation to Save Data
I have a query slow in Oracle to list all the accesses of a user, so I thought to record the result in a Session, the average of records returned is 600, it’s too much for a Session? Would there be…
-
2
votes1
answer259
viewsQ: Search all methods without reference Visual Studio
How to search all methods without reference in Visual Studio, ie methods that are not being used, know that by clicking on a method with the right button and and choosing "Find All References" it…
-
3
votes1
answer1226
viewsA: Update does not give error but does not update in the database
You are not putting the Where condition in your update, the way it is, it updates everything, change the sql to = $sql = "UPDATE veiculo SET nome = '$nome', tipo = $tipo WHERE id = $id"; I advise…
-
4
votes2
answers461
viewsA: How to sort the results of a ranking?
I would use the PHP to convert the time into seconds, and then record only the number in the database, can make a scoring system, example 1 second is equal to 3 points, lost a life -100 points, then…
-
1
votes2
answers230
viewsQ: Jquery find input containing specific text
Which selector jquery that I use to search for all inputs that contain specific text, for example I have several checkbox with different texts, ai type CA and it searches all checkbox with text that…
jqueryasked henriquedpereira 4,415 -
3
votes1
answer184
viewsA: Viewdata["Errormessage"] does not appear in view
How are you utilizing the RedirectToAction the ViewData if lost, for this you must use the TempData. The TempData uses Session to save the data, it gets lost after the display. The lifetime of the…
-
1
votes2
answers505
viewsA: Set value for combo with Ajax
In case the best way is not to pass id for <option> and yes to the <select>, and in the code you arrow the values, you pass the select id with the value. Your html: <select…
-
3
votes1
answer100
viewsA: Use/Escape @ in CSHTML view
To escape where you have @ puts @@. Thus remaining: var filtro =…
-
3
votes3
answers761
viewsA: Error Calling Jquery function
To run you need to give the include do js twitter bootstrap 3. As you are using Asp . Net MVC, you can use bundle, in the archive BundleConfig.cs you set up like this: bundles.Add(new…
-
2
votes3
answers9416
viewsA: Size and position of the Bootstrap Carousel on the page
Use the bootstrap grid system, using the classes row and col-xs-6, do so: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"…
-
1
votes2
answers1665
viewsA: edit docx file and save to PDF in php
Use the PHPDOCX library = http://www.phpdoc.com/ and https://github.com/benskay/PHP-Digital-Format-Convert-Epub-Mobi-PDF/tree/master/library/phpDocx, that has the paid and free version also. Open…
-
3
votes1
answer3806
viewsA: Does anyone know a program to decompile an apk and get the source code?
Have these tools online = http://www.decompileandroid.com/ and http://www.javadecompilers.com/apk, has also APK Studio, which does the reverse engineering of apk =…
-
4
votes1
answer136
viewsA: How do I add attributes in img with the_post_thumbnail Wordpress function?
Do it like this: <?php $thumb_id = get_post_thumbnail_id(); $thumb_url = wp_get_attachment_image_src($thumb_id,'thumbnail-size', true); echo "<img src='".$thumb_url[0]."' width='100%'…
-
28
votes2
answers12475
viewsQ: What is the Antiforgerytoken?
What is the AntiForgeryToken and what it serves as in an ASP.NET MVC application?
-
6
votes1
answer726
viewsA: How to insert returned value into form fields with jQuery?
I followed a working example: var jsonString = '[{"Descricao":"controle","Data":"2015-09-03","Hora":"17:36:00","IdTipoFase":1}]'; var registro = JSON.parse(jsonString); $(document).ready(function()…
-
1
votes1
answer68
viewsA: How to block cell phones from accessing the website?
You can use this open source script, which is available for various languages = http://detectmobilebrowsers.com/ Example, I chose php, just put the code in index.php and then change the redirect…
-
3
votes2
answers635
viewsA: What’s the difference from ON to ONE in Jquery
For when you only want to run once per type, example: $(".target").one("click mouseenter", function() { $(".count").html(++n); }); Will run the code once when clicking and once when hovering the…
-
6
votes1
answer1306
viewsA: Display or Hide Fields for Natural or Legal Persons
For this you can use jquery, using classes, thus: $( document ).ready(function() { $(".campoPessoaJuridica, .campoPessoaFisica").hide(); }); $("input:radio[name=tipo]").on("change", function () {…
-
2
votes3
answers1312
viewsA: How to install Angular JS modules?
You have to give the include of the js module in your application and then pass the dependency on your app, example: In html: <script src="angular-route.js"> In its main module:…
-
2
votes2
answers3368
viewsQ: Send email using ASP.NET MVC
How do I send email using ASP.NET MVC? Do you have an option to send without specifying SMTP similar to mail() of PHP?
-
3
votes2
answers636
viewsA: Mention HTML code in Wordpress post
Usa <code></code> Take a look at: https://codex.wordpress.org/Writing_Code_in_Your_Posts…
wordpressanswered henriquedpereira 4,415 -
1
votes1
answer955
viewsQ: How to use Url.Action in a Razor Helper?
In an ASP.NET MVC5 project, I created a Helper inside the briefcase App_Code, however, when using the function Url.Action() in my Helper the following build error occurs: CS0103: The name 'Url' does…
-
2
votes1
answer955
viewsA: How to use Url.Action in a Razor Helper?
Within the Helper we do not have access to Helpers standards, to use them it is necessary to pass as parameter. The code of Helper, gets like this: @using System.Web.Mvc @helper…
-
8
votes1
answer7864
viewsQ: Function to generate random alphanumeric characters
I need a C# function that manages a String of random alphabetic and numerical characters of size N.
-
11
votes1
answer7864
viewsA: Function to generate random alphanumeric characters
Follows the function that receives as parameter the amount of return characters, and returns a string. public static string alfanumericoAleatorio(int tamanho) { var chars =…
-
0
votes2
answers93
viewsA: Can anyone explain this logic to me in Wordpress?
I put the commented code: <?php $i = 0; //Faz uma consulta dos posts, recebendo o parametro post_type, que pega os posts do tipo cpt $post_type = new WP_Query( 'post_type=cpt' ); //Verifica se…
-
18
votes5
answers51834
viewsA: In Javascript, how to verify that an object is empty (without jQuery)?
You can use this function: function isEmpty(obj) { for(var prop in obj) { if(obj.hasOwnProperty(prop)) return false; } return true; } It loops the properties of the object and uses the method…
-
3
votes2
answers8159
viewsA: Type only letters and dots
Can do using regular expression [a-zA-Z.], thus: jQuery('.meucampo').keyup(function () { this.value = this.value.replace(/[^a-zA-Z.]/g,''); }); <script…
javascriptanswered henriquedpereira 4,415 -
5
votes1
answer3559
viewsA: Webservice REST Simple
To php I suggest you use a framework called PHP Slim Framework, is very easy to use, give a look: http://tableless.com.br/php-slim-framework/ Example of use: <?php require…
-
0
votes1
answer246
viewsA: Youtube videos do not open on full screen
In the latest version of the youtube api, you can set the parameter playsinline for 1, to learn more, take a look at the documentation:…
-
1
votes2
answers135
viewsA: Javascript - Populate a field with paragraph
Usa .replace(/\r?\n/g, '<br />'), example: var txtBox = $('textarea'); txtBox.keydown(function(e){ var that = this; setTimeout(function(){ var html = that.value.replace(/\n/g,"<br/>");…
-
25
votes2
answers8421
viewsQ: What is Cross-Cutting and what is its relationship to Aspect Oriented Programming (AOP)?
What is Cross-Cutting and what is its relation to Aspect Oriented Programming (AOP)? And in a DDD architecture what is its function?
-
0
votes3
answers13847
viewsA: Pick up value from a radio button
In your case the two inputs are with the same id, you can change the id, or pass the element itself as a function parameter like this = onchange="soma(this)"; and then change your js to receive the…
javascriptanswered henriquedpereira 4,415 -
2
votes2
answers2013
viewsA: Modal Bootstrap > While Loop > Open Modal Item
Create a function in js that you call it by passing the id of the movie, then this function calls its single.php for ajax passing the id and then loading the html from single.php within the modal…