Posts by Alessandro Gomes • 730 points
25 posts
-
3
votes1
answer4875
viewsQ: Replace inverted bars with single bars - image URL
I am trying to remove the backslashes to open the image URL, I found a way to replace, but part of my string was lost: function formatURL( $url ) { echo $url."<br />"; $url = str_replace('\\',…
-
1
votes1
answer113
viewsQ: How to return the 'Parent ID (Main)' in this Mysql query?
I’m trying to return the parent ID at the highest level in a query, this is the information: ID NOME PARENT_ID 1 Project (null) 2 Sub 1 3 Sub-Sub 2 4 Sub-Sub-Sub 3 I need this: ID NOME PARENT_ID…
mysqlasked Alessandro Gomes 730 -
0
votes1
answer96
viewsA: Simplesaml using Cakephp - Simplesaml_error_nostate: NOSTATE
Resolution link: https://github.com/zl4bv/CakePHP-simpleSAMLphp-Plugin/issues/7#issuecomment-63427478 I needed to change the session type to 'sql' in the file config/config.php: 'store.type' =>…
-
0
votes1
answer96
viewsQ: Simplesaml using Cakephp - Simplesaml_error_nostate: NOSTATE
I’m trying to configure simpleSAMLphp using Cakephp, in the project using only PHP works all right but using Cakephp-simpleSAMLphp-Plugin I got the errors when I try to access the View: Warning…
-
1
votes0
answers166
viewsQ: How to return a list of Google Contacts?
I’m developing a view to show the latest emails, recent drive items and etc using Google Apis : http://developers.google.com/apis-explorer/#p/ But here there is nothing that returns the contacts.…
-
2
votes1
answer179
viewsQ: Insert markup in Progress bar
I couldn’t find a way to insert a mark in the bar, I’m trying to show a mean. How is it: How I’d like to show the average: Does anyone know how I can do it with bootstrap?…
twitter-bootstrapasked Alessandro Gomes 730 -
0
votes1
answer1190
viewsQ: Default route controller/action and links to css/js do not work cakephp
After extracting cake 2.5.2 to the directory (Linux) /var/www/html/teste when accessing the url http://localhost/teste it loads the contents correctly from the controller pages and action display…
-
1
votes2
answers6646
viewsA: Subtraction of dates and return the number of years, months and days
In this function you can pass by parameter which return you want, you can also customize to make more generic for your case: function getDateDiff(date1, date2, interval) { var second = 1000, minute…
-
1
votes1
answer718
viewsA: How to return real value from a column in jQuery datatables
Link to the reply on SOEN Basically the correct is to use the "mRender" not changing the real value in the variable when accessed by var full: { "mData": 1, "bSortable": false, "mRender":…
jqueryanswered Alessandro Gomes 730 -
1
votes1
answer718
viewsQ: How to return real value from a column in jQuery datatables
I am feeding my table by ajax and customizing the return. In the column status( 0 or 1 ) I used the "fnRender" to return a label of active or inactive according to the value, but I need to use this…
jqueryasked Alessandro Gomes 730 -
1
votes1
answer418
viewsA: Loading jQuery on Gento only if it has not been loaded before
I found a script on SOEN that can help you, try adding this block of script on the page that needs to perform validation: <script> if(!window.jQuery) // verifica se foi carregado { var script…
-
2
votes3
answers28540
viewsA: Create an array with objects in Javascript
You need to clear the variable oItem, keep her creation out of the loop and try this: //Para cada linha do grid, busca os resultados mygrid.forEachRow(function (id) { //Se o Codigo do item for maior…
-
1
votes2
answers7844
viewsA: How can I get the id in classes with equal names?
Try doing a function to check a property of the element itself (removing unnecessary html code), something like (I removed the span hidden value in html and set a value for name) : <div…
jqueryanswered Alessandro Gomes 730 -
0
votes2
answers1070
viewsA: Redirect ASP NET
You can assign a function Assigning to Onclientclick Event to call a Javascript function on a asp:Button: <asp:Button ID="ButtonD" runat="server" Text="Button" onclientclick='redirect()' /> Or…
-
1
votes1
answer60
viewsA: How to use minimum_should_match searching for more than one field?
I had to use the bool and multi_match, this is the right way: { "size":"30", "from":0, "query":{ "filtered":{ "query":{ "bool":{ "should":[ { "multi_match":{ "query":"portugues",…
elasticsearchanswered Alessandro Gomes 730 -
0
votes1
answer60
viewsQ: How to use minimum_should_match searching for more than one field?
I am trying to filter my Elasticsearch result where the results should be returned where they are 80% compatible with the searched text. When I use only one column the rule of minimum_should_match…
elasticsearchasked Alessandro Gomes 730 -
8
votes2
answers633
viewsQ: Sort array by a property
I am trying to sort an array by a specific property(weight), I found some possible solutions but they did not work for my case, someone would know where I am doing something wrong or another way out…
-
0
votes1
answer191
viewsQ: Performance difference in creating FK Mysql
Can anyone tell if there is a difference in bank performance if I create FK’s before the other fields in the table or vice versa? I heard comments that the ideal is to always leave FK’s as the first…
-
2
votes8
answers56968
viewsA: PHP echo Special character problem ("ç")
To use the htmlentities() in your case, do the following: $uppercaseMonth = htmlentities(ucfirst(gmstrftime('%B')));
-
0
votes2
answers186
viewsA: Web service, play dice in empty field bd error
Friend, I have a kick, try to open a transaction before making the Inserts on foreach: $this->db->trans_start(); And close it after the foreach: $this->db->trans_complete();…
-
4
votes3
answers2600
viewsQ: Align text within <select> in Firefox
I’m trying to line up the text inside a <select> but it is only aligned (by default) using Chrome and IE11 browsers (amazingly enough), only in FF(v27.0.1) that the text is at the top. I’ve…
-
6
votes2
answers7182
viewsQ: How to send an Array via POST to a PHP controller
I need to pass an array via POST to my PHP controller, the only way I have in mind is not to pass an array, but to pass the information through a separator (, |), but I didn’t want to keep giving it…
-
6
votes4
answers9080
viewsQ: Select2 with AJAX
For some reason my Select2 using AJAX to fill it is not working. When I put a Debugger in the code, it does not enter the method result: and also returns no error. HTML: <input type="hidden"…
-
5
votes4
answers41617
viewsA: Sign of different Query
The right would be (has a IS there that is not necessary): ... AND AlvaraValidade != '0000-00-00' Or: ... AND AlvaraValidade <> '0000-00-00'…
-
13
votes4
answers3372
viewsQ: Generate random numbers that result in a fixed sum
I need to generate random values for the inputs text of my table (remembering that it can have N lines), my code today can generate the numbers but I need the generated number to be at most X so…