Posts by Leonardo Patricio • 1,656 points
54 posts
-
1
votes1
answer28
viewsA: Android capture device rotation without rotating the application
Solution found: SensorManager sensorManager = (SensorManager) this.getSystemService(Context.SENSOR_SERVICE); sensorManager.registerListener(new SensorEventListener() { int orientation = -1;…
-
0
votes1
answer28
viewsQ: Android capture device rotation without rotating the application
I have an application with Android Webview, my Activity is configured to portrait: <activity android:name=".activity.MainActivity" android:screenOrientation="portrait"…
-
1
votes1
answer344
viewsQ: Permission of GIT files
All my systems I have are giving permission problem after I give one git pull, so that for example I have a folder where my js and css files are generated mimicked. Folder Assets/min/, after I give…
-
1
votes1
answer501
viewsQ: Android send message to various Whatsapp contacts
I have an application that today displays the contacts in the calendar that have Whatsapp, and there it is possible to excrever a message in this application and send to the users of Whatsapp, but…
-
2
votes1
answer656
viewsQ: Doctrine 2 INNER JOIN with Subquery
I’m migrating my appointments to Doctrine using the Querybuilder. And I have a consultation with Inner Join with a subquery, would like to know how to do this using Doctrine. SELECT p.* FROM…
-
0
votes1
answer175
viewsA: Hide Buttons and Enable Other with ajax
I would make the following change in your HTML, leave the div.resp with display:none, and would leave a button[data-dismiss=modal] inside it, along with a div.msg, when the ajax gives the answer,…
-
2
votes0
answers179
viewsQ: Auto ID increment relative to another field
I have been looking for something to solve such problem that I have been finding in other systems that I developed, I would like to know a solution for how to make an id auto increment, but an auto…
-
0
votes1
answer61
viewsA: Promotion Ecommerce consultation
Solved using functions. Links that helped: Procedures and functions Cursor…
-
2
votes1
answer61
viewsQ: Promotion Ecommerce consultation
I’m developing a platform Ecommerce, and I came across a problem to calculate the value of products, applying the discount of promotions in consultation SQL, currently the promotion rules are being…
-
0
votes2
answers1453
viewsQ: Index views in Mysql
I have a view in my Mysql database, I would like to know if it is possible to index the fields that are contained in it, because I have a group by on it that is consuming much, and a index would…
-
1
votes0
answers45
viewsQ: Nginx Rewrite router
Good morning guys, there is some way that I can make the rules below without having to keep repeating the root folder, in this case without having to see all write "rewrite /Pw/... /Pw/... last;"…
-
4
votes2
answers792
viewsQ: PDO vs Doctrine
Work with systems development in PHP, more focused on e-commerce. Currently I use the PDO to make my connection to a database, but out of curiosity I decided to search about the Doctrine, because…
-
2
votes1
answer61
viewsQ: .htaccess import another rule file
Guys, I have the following problem, I have an administrative area where can be registered page redirects, and these redirects are saved in the bank, currently I redirect via PHP, but I would like to…
-
0
votes1
answer593
viewsQ: Java cast and convert
How do I convert ValueCallback<Uri> for ValueCallback<Uri[]>?
-
0
votes1
answer45
viewsA: How to keep the colors of items that had the colors changed from listview on Android?
Extend the Application class of android,and have an Arraylist Static inside your application to save these colors, save color and position of the item in the list of Arraylist. Detail this…
androidanswered Leonardo Patricio 1,656 -
11
votes1
answer486
viewsQ: Push android with Amazon SNS
I’m trying to push an android app, but I’m not getting the push in my app. Manifest.xml <?xml version="1.0" encoding="utf-8"?> <uses-permission…
-
1
votes0
answers93
viewsQ: Android - Httpurlconnection cookie
I have a native login screen on android, which the user enters login and password, and does a check via Httpurlconnection if the data is correct, if yes then it saves the cookie, and returns that…
-
2
votes1
answer1105
viewsQ: Android - Align Layout above the keyboard
I have the following layout: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/view_login"…
-
0
votes1
answer92
viewsQ: Android Animate object height
I have an object in my view but it starts with visibity=GONE and would like to animate it to appear, like a slideDown and JQUERY slideup. <LinearLayout android:layout_width="match_parent"…
-
0
votes0
answers183
viewsQ: Different results for Mysql 5.1 and 5.7 query
We developed a project for a client using Mysql 5.1.68 and at the time of publication we identified that the client’s hosting had version 5.7.4. After publishing the project, we started to check…
-
1
votes1
answer29
viewsA: Difficulty to get information through Regular Expressions
Hit on to : preg_match_all("/title=\"(.*)\"|<strong>(.*)</strong>/", $url, $conteudo);
-
1
votes2
answers64
viewsQ: Query Query 1:N
I have the following tables: Tabela: estoque id_estoque nome Tabela: atributos id_atributo id_estoque nome And for example I need to know if there are 2 name attributes X and the name Y stocked Z.…
-
1
votes1
answer131
viewsQ: FOREACH or FOR?
Regarding code performance which is more advantageous, use foreach or for? Example: $array = array(1,2,3,4,5,6,7,8,9); //assim foreach($array as $value) { } //ou assim $count = count($array);…
phpasked Leonardo Patricio 1,656 -
5
votes1
answer751
viewsQ: Indexing of Database
What is the advantage of maintaining an indexed database, with Foreign key and indexing of the most used fields as in searches?
-
1
votes1
answer806
viewsA: Counting of week-specific days between two dates
Before the while creates the following variable: $array_semana = array(); And inside the while soon after: $begin += 86400; // +1 day, insert: $array_semana[$what_day]++; So at the end of the while…
phpanswered Leonardo Patricio 1,656 -
1
votes2
answers109
viewsQ: Get Outer html
How do I get the outerHTML of a jquery object? The following is not working. $("selector").outerHTML;
-
0
votes3
answers140
viewsA: Search results in 3 tables with the date of the last 5 days
SELECT nome, COUNT(tb2.id) recursos, COUNT(tb3.id) votos FROM tbl_utilizadores tb LEFT JOIN tbl_recursos tb2 ON tb.id = tb2.id_user AND tb2.data > (NOW() - interval 5 day) LEFT JOIN tbl_votos tb3…
-
3
votes1
answer205
viewsQ: Jquery cancel ajax request
How can I cancelar uma solicitação do Ajax that has not yet received the answer using Jquery.
-
5
votes8
answers2700
viewsA: Is it good practice to mix Php and Html?
It’s not good practice, that’s dificulta much manutenções future, the ideal would be the use of architecture MVC, where you separate your model, controller e view. To make your life easier, has a…
-
9
votes4
answers20245
viewsA: PDO:: Fetch & Fetchall
Good friend the difference between the fetch and the fetchAll is in return. In the case of fetch is a simple array, while in fetchAll is a multidimensional array, also called a matrix. In your…
-
0
votes1
answer373
viewsQ: Update PHP files via code
I have a php application on the online server and I have this same application installed on other machines and tablets, I would like to know a way so that I can update my application on the online…
-
3
votes1
answer618
viewsQ: Access Dropbox folder on Android
Is there any way to access the Dropbox folder? I have the following problem, I am developing a webapp that will work local in tablets of an event, so for this I am using the Androphp app and I would…
-
2
votes1
answer115
viewsA: Error hiding <div> by selecting <option> in a form with javascript
Missing line 12 and 13 # to indicate id, change: $ ('rescind').hide(); $ ('justcausa').hide(); for: $ ('#rescind').hide(); $ ('#justcausa').hide();…
-
0
votes3
answers739
viewsA: Can a video accelerator card improve non-fiction performance?
In a way yes, because for example a graphic activity that was previously stored the memory of the machine happens to be executed by the memory of the card, so this memory space of the machine would…
performanceanswered Leonardo Patricio 1,656 -
1
votes1
answer899
viewsQ: What are the advantages of PDO::FETCH_OBJ?
What are the advantages of using PDO::FETCH_OBJ? I know it returns me an object instead of an array, but what are the advantages of code performance?
-
1
votes3
answers140
viewsA: Sort images by height of each one
$(function () { var alturas = new Array(); var _height = 0; $(".parceiros img").each( function () { alturas[$(this).height()] = $(this).height(); } ); alturas.sort(function (a, b) { return a - b });…
-
1
votes4
answers1147
viewsA: Mark checkbox if user writes input text in a table
<input class="input" name="inputquant" type="text" /> Putting a class in the text input, js would look like this: $(function(){ $(".input").keyup(function(){ if($(this).val()){…
-
0
votes8
answers6579
viewsA: Check user browser in PHP
I think the use of this iframe can help you. <iframe src="http://www.whatismybrowser.com/feature/iframe?capabilities=true" width="600" height="370" style="border: none; overflow: visible…
-
3
votes2
answers196
viewsA: How to write this Mysql code correctly?
Alter $result = $mysqli->query($query); for $result = mysqli::query($query);. But I recommend the use of PDO, due to the greater security that will acquire.
-
5
votes2
answers86
viewsQ: PHP Application Class
In PHP there is some class that works until for example I close the tab of my browser, without being a cookie, I wonder if there is any class that I can extend so that I can save some values until…
phpasked Leonardo Patricio 1,656 -
0
votes1
answer1558
viewsQ: Access playlist music Android
I’m developing an APP for Android, that I need to access the playlist of songs, in case it would be as follows would load a home screen with the playlists it has and a category with all songs, and…
androidasked Leonardo Patricio 1,656 -
3
votes2
answers5325
viewsA: How to force the "change" event of an input select, even without choosing another value?
Only simulates the change as follows: $("selector").change(); Change the JS to: $("#cb").change(function(){ var cb1val = $(this).val(); $("#cb2 option").each(function(){ if($(this).val() <=…
-
13
votes2
answers1997
viewsQ: How to detect Ajax Request?
Is there any way in PHP to detect if the request made is Ajax?
-
15
votes2
answers2984
viewsQ: Google Play private app
There is the possibility to do the upload of an app for Google Play and it is only available for a list of users of my interest? As happens on youtube that can only see that video who has permission…
-
5
votes2
answers8457
viewsQ: Close PDO connection
I have worked with other languages before working with PHP and in some the framework when you opened a connection with the database was good to finish it, in PDO so I realized there is a function in…
-
3
votes1
answer672
viewsQ: What better way to make animations for android?
I’m about to start an android system that has several animations that interact according to what the user does, I would like to know what is the best tool or framework to be able to develop these…
-
1
votes1
answer818
viewsA: Redirect with click jQuery/Javascript
This way it is not possible, because there is no way you can run the object of another page through the current page by javascript. What I would advise is that you go through the URL var index =…
-
1
votes1
answer621
viewsA: What is the best value for PHP’s memory_limit with 4GB of memory?
In scripts that have a more robust logic, where the memory consumption is higher, enter the following, to perform tests and know the memory consumption that a user has on his server, and multiply…
-
4
votes1
answer391
viewsQ: What is the weight of a subquery for the query?
During the development of some queries in the database, I come across the situation of the need to perform a new query, but another solution in some cases may be the subquery. So what is the best…
-
24
votes4
answers4178
viewsQ: What is the difference between joining tables by JOIN and WHERE?
What is the difference between joining tables by JOIN or by WHERE? Examples: SELECT * FROM clientes c JOIN enderecos e ON c.id = e.id_cliente; SELECT * FROM clientes c, enderecos e WHERE c.id =…