Posts by henriquedpereira • 4,415 points
97 posts
-
1
votes2
answers855
viewsA: Update from change in select
Here’s an example to simplify what you want to do, so you’ll center the update on just one request ajax, used the attribute data, passing the data-tipo for each select. How the values are similar in…
-
28
votes2
answers16435
viewsQ: What are the out and ref parameters
What is the use of parameter types ref and out of a method in C#? What is the difference between the two? Some example of each one’s use.
-
14
votes2
answers306
viewsQ: #Region is an antipattern or a Smell code?
The #region from Visual Studio he hides the codes, everyone says he’s bad, because he exists? It’s a antipattern or a code Smell?
-
2
votes3
answers1823
viewsA: How to implement spinner loanding in Angularjs?
You can use it this way, it will only appear while $scope.loading for true. app.controller('myCtrl', function ($scope, $http) { // Show loading spinner. $scope.loading = true;…
-
2
votes1
answer46
viewsA: Asp Net MVC longPolling
Giving a search on the net, I verified that this behavior occurs, because it is using the Browser Link Visual Studio 2013. Browser Link is a feature of Visual Studio 2013 that creates a…
-
1
votes1
answer46
viewsQ: Asp Net MVC longPolling
I have a project Asp net mvc 5, verified that every second a request is made, passing these parameters = transport=longPolling&connectionToken="", and as an answer comes…
-
3
votes1
answer5794
viewsA: Using mysqli to count records
One way to use is to count directly into SQL, like this: <?php $query = "SELECT COUNT(owner_email) AS TOTAL FROM owner WHERE owner_email='$email' AND password='$password'"; $result =…
-
2
votes2
answers47
viewsA: Enable fields in Jquery
It can be done like this, from a common class to the inputs, in the example I used classeteste, and can use a code similar to that: $(function() { $("#IDDOPRIMEIROINPUT").keyup(function(){…
jqueryanswered henriquedpereira 4,415 -
1
votes3
answers2496
viewsA: Problem with special characters
Probably the problem is in the Blade Database (Laravel Template System), goes in the file app/Providers/AppServiceProvider.php and leaves the method boot thus = public function boot() {…
-
1
votes1
answer621
viewsA: PHP Regex remove IMG attributes and change SRC
After doing some tests I managed to make a solution, follow the online link = http://www.regexr.com/3bkaa The code in php was like this: $html =…
-
3
votes1
answer621
viewsQ: PHP Regex remove IMG attributes and change SRC
I have the following string with the html: teste = "<img src="image/teste.jpg" alt="" width="32" height="32"> <p>teste</p> <img src="image/teste2.jpg" alt="" width="132"…
-
4
votes1
answer878
viewsA: Check if value exists before updating
The ideal is to leave the field UNIQUE, but if for some reason you need to do it, you can use a query similar to this: UPDATE suatabela SET seucampo = 'seuvalor' WHERE seucampo NOT IN (SELECT…
postgresqlanswered henriquedpereira 4,415 -
2
votes2
answers704
viewsA: Sending json files to server
You are not passing the fields on the date, use so: function CadastrarMembro(){ $.ajax({ type: "get", dataType : 'html', url: $server+"/pdo_acao.php", data: $('#form').serialize() +…
-
1
votes3
answers187
viewsA: Omitting Else is a good idea in some cases, right?
It depends a lot on the need of logic, depending could use another way: if(condicao) { //alguma logica } else { //alguma logica } return resultado; But in using else and omit the else, it’s the…
-
4
votes1
answer315
viewsA: Is there any possibility of performing a javascript action after the end of a download?
Uses the jquery plugin named fileDownload, example usage: // //With jquery.fileDownload.js //custom use with promises // $(document).on("click", "a.fileDownloadPromise", function () {…
-
3
votes3
answers1134
viewsA: How to access the $Cope variable?
Or mute $scope.teste for this.teste no js, that will work. Or in html changes {{'TESTE:' + bandas.teste}} for {{'TESTE:' + teste}}
-
5
votes3
answers933
viewsA: Script swap image every Reload
You can do it using a cookie, something like this: $(function() { var bannerAtual = readCookie(bannerAtual); switch(bannerAtual) { case 1: //logica para colocar o banner 1 break; case 2: //logica…
-
4
votes1
answer74
viewsQ: Comment equal #Region from Visual Studio
There is similar comment #region Visual Studio in PHP with Netbeans?
-
-1
votes2
answers304
viewsQ: Php preg_replace replace src image
I would like to know how to add the site url in front of the existing src of all images of an example string: <img src="images/teste.jpg" border="0" width="486" height="370" style="margin: 5px;…
-
0
votes1
answer127
viewsA: Invoke ajax error
Ideally you manage the request status with php, you can use it like this: if ($tudo_ok) { header('Content-Type: application/json'); print json_encode($result); } else { header('HTTP/1.1 500 Internal…
-
2
votes1
answer173
viewsQ: Asp Net MVC Authentication Extending Authorizeattribute
I am doing authentication extending Authorizeattribute, I have two doubts, in my DDD application, I will create this class in DAL? And how I leave this global class to use on all controllers?
-
2
votes1
answer96
viewsQ: Asp Net MVC Block Permission
I am separating the permissions in my application, I am using a custom authorization with the Authorize class, I can already separate permission by action and controller, I would like to know how to…
-
1
votes2
answers170
viewsQ: How to edit a Partial Class?
I took a project from a client, and there’s a class that’s on a partial. When I click to go in the reference opens the file, but in the project I can’t find the file, and has the following text in…
-
2
votes1
answer189
viewsQ: ASP NET MVC authentication
What better way to separate permissions for logged in users? Would it be using annotations and roles? Because I want to release certain pages and certain functions depending on the permission of the…
-
1
votes3
answers1212
viewsA: Why can’t we destroy [using unset in] a static variable?
Take a look at the documentation, la fala: If unset() is used with a static variable within a function, unset() destroys the variable only in the context of the rest of the function. Following calls…
-
3
votes3
answers638
viewsA: How to run PHP in interactive mode?
You can use it like this: C:\>php -a Interactive mode enabled <?php echo "Hello, world!"; ?> ^Z Hello, world! To work with <?php ?>, first you activate the interactive mode, type the…
-
2
votes1
answer3169
viewsA: How do I connect to the database via [Wordpress] to query?
To make queries in wordpress first you have to give a include in the configuration files and db so: define( 'BLOCK_LOAD', true ); require_once( $_SERVER['DOCUMENT_ROOT'] . '/wp-config.php' );…
-
1
votes1
answer3005
viewsA: How can I change the color of scrollbar inside a div?
For this use as below changing the values. .suadiv{ scrollbar-face-color: #367CD2; scrollbar-shadow-color: #FFFFFF; scrollbar-highlight-color: #FFFFFF; scrollbar-3dlight-color: #FFFFFF;…
-
6
votes4
answers8564
viewsA: What good is a gists on the github?
Github is the whole site. Gists are a particular service offered on the site , ie code snippets similar to Pastebin . However, everything is driven by git revision control, so gists also have full…
githubanswered henriquedpereira 4,415 -
0
votes2
answers535
viewsA: HTTP GET using localhost
It may be a crossdomain problem, check the Whitelist of your phonegap application, take a look at the official documentation = http://docs.phonegap.com/en/4.0.0/guide_appdev_whitelist_index.md.html…
-
1
votes1
answer307
viewsA: Changing a Label control when changing a textbox control
Uses the onchange, then to take the value uses = var value = document.getElementById('idinputcpf').value; And to set the value to the label uses = document.getElementById('idlabel').value = '';…
-
43
votes4
answers31911
viewsQ: What is the difference between compiled language for interpreted language?
What difference from compiled language to interpreted language, and what advantages to one another?
-
1
votes3
answers1728
viewsA: How to recover information from database by id on Ionic?
At the angle you need to create a Service and inject the competent $http, then you call your PHP file that should return a JSON = // Simple GET request example : $http.get('/urldoarquivo.php').…
-
0
votes1
answer77
viewsA: Help in creating the . htaccess file
You can only use this htaccess = RewriteRule . /index.php [L] And treat all logica in this index.php, using the command = $url = explode("/", $_SERVER["REQUEST_URI"]); Access a url and print on the…
-
1
votes1
answer415
viewsA: Modal bootstrap MVC 5
You are only loading the bootstrap JS, you have to load the CSS too, do a test, put this tag in your header = <link rel="stylesheet"…
-
3
votes2
answers1067
viewsA: Draw image using css
It is possible yes, using HTML and CSS, here is a generator for you to get an idea of how to do = http://www.samuelrossille.com/css-shape/#1142AAy15z-15z-19z29z0 You will always have to have at…
-
0
votes1
answer112
viewsA: How to block internet explorer access?
Use like this: RewriteEngine on RewriteCond %{HTTP_USER_AGENT} "MSIE [6-8]" [NC] RewriteRule ^(.*)$ http://mysite.com/ie [R=301,L] It will redirect to http://mysite.com/ie, where you can put some…
htaccessanswered henriquedpereira 4,415 -
4
votes4
answers18115
viewsA: Convert Array to String
Do it like this = $bMsg3[] = 400; $bMsg3[] = "Hello World!"; $bMsg3[] = 3.14; $bMsg3[] = 200.0; // Converte para string $str = implode(':', $bMsg3); print "String: $str"; ?> Result = String:…
phpanswered henriquedpereira 4,415 -
0
votes1
answer42
viewsA: Report using array
What you can do, is to loop this array, group by FK, then loop the already grouped array, in each returned item loop the dates and display in the report.
phpanswered henriquedpereira 4,415 -
0
votes4
answers545
viewsA: File Subdomain, Site Optimization
This is an HTTP 1.1 problem, which we currently use is a sequential protocol. This means that when we open the connection, we can make one request at a time. Will 1 request, we wait, arrives the…
-
3
votes3
answers644
viewsA: Hide html img tag
If from the database it returns NULL when there is no image just do so = <?php if($img){ ?> <img src="<?php echo $img; ?>"/> <?php }else{ ?> <img src="imgpadrao.jpg">…
phpanswered henriquedpereira 4,415 -
0
votes2
answers2549
viewsA: Codeigniter + Pagseguro
Use this example that Pagseguro created in PHP from Transparent Checkout. This example is intended to illustrate the features of transparent Checkout and the use of JS features. The file is…
-
0
votes1
answer465
viewsA: Deploy dependent Select with AJAX and Jquery in Zend
Jquery code //Chama assim que você altera o select $( "#id_municipio" ).change(function() { //guarda o value do item selecionado do select var id_municipio = $(this).val(); //Requisição ajax…
-
1
votes2
answers481
viewsA: What are the Types of Ioc?
The types you refer to are the 3 ways to implement inversion of control, which are: Standard Factory Standard Service Locator Dependency injection
-
1
votes1
answer86
viewsA: Help Jquery upload script
I advise you to use some jquery plugin to do this, from a search by uploadify, it has several options of customizations, accepts many files or only one, as you look for. Here is a tutorial =…
-
1
votes2
answers786
viewsA: Modal display when submitting a form
If you are using jquery you can use: $("form").submit(function(e){ //Ação para abrir o modal }); Once clicked on the button it will display the modal and as soon as it is done the post the page will…
-
4
votes1
answer471
viewsQ: Design Patterns - DTO, POCO, MODEL
What’s the difference between DTO, POCO, MODEL? Because I am developing a layered application, DAL, BLL and UI.