Posts by Marcelo de Andrade • 7,261 points
255 posts
-
1
votes1
answer91
viewsA: What is the C++ vector
The class Apvector is class-based Vector, and all methods belonging to it are also part of Vector. It’s a template that you can specify what kind of collection it will work with. Some features of…
-
7
votes1
answer3811
viewsA: Javascript for a flowchart
If you just want an alternative to creating flowcharts, Google has the library Chart and in it there is the option Organization Chart. google.charts.load('current', { packages: ["orgchart"] });…
-
1
votes2
answers89
viewsA: Changing top of a cakephp page only
I don’t remember very well, I haven’t worked with Cakephp for a long time, but one of the possible solutions is to work with multiple layouts. For the specific view, you can set a different layout…
-
1
votes2
answers161
viewsA: How can I use something like an IF in an SQL query
Mysql can be used as follows, as it was almost already doing: SELECT x.Column1 "Alias", y.Column2 "Alias2", FROM table x INNER JOIN table y ON (x.Column3 = y.Column2 OR x.Column4 = y.Column2)…
-
1
votes0
answers50
viewsQ: How can an inline style cause security problems?
Working with the Twitter API, I received the following message in the browser when trying to authenticate: Refused to apply inline style because it violates the following Content Security Policy…
-
0
votes1
answer75
viewsA: What is a datatype "Tarsus"
Tarsus is just any name for the key. Its content represented in this key is just a compacted form of a Topojson.…
-
9
votes1
answer189
viewsQ: Why is the incrementer "lost" in the loop?
Making a simple loop FOR, I found a strange behavior that I couldn’t understand. The count is "lost" in the AJAX request, keeping the value of the incrementer with the last one. The request to the…
-
0
votes1
answer33
viewsQ: Unexpected token : from a URL with extension . json
When trying to get a JSON through the URL: http://www.cidades.ibge.gov.br/gmap/shapes/35/MU_M13_3550308_1000.json I get a status 200 with the error: Uncaught SyntaxError: Unexpected token : Using…
-
0
votes1
answer75
viewsQ: What is a datatype "Tarsus"
Observing some IBGE maps, a specific map caught my eye. He’s being ridden with Openlayers and in a way not so complex, but there is a call for a API of the IBGE where he brings a JSON, within it…
-
2
votes1
answer20
viewsQ: How to select lines from 1 to N above
I have a dynamically generated table in the following scheme: <table> <tr class="row-1"> <td>A</td> <td>1</td> </tr> <tr class="row-2">…
-
3
votes1
answer594
viewsA: What is PJAX and how to detect a PJAX call in the back end?
PJAX is an acronym for Pushstate Ajax, and is nothing more than the combination of existing methods and technologies: The method Pushstate belongs to API History HTML5 and with it you can manage the…
-
2
votes1
answer32
viewsQ: jQuery selector eliminating zero incorrectly
In the following case, you have a code being entered in the attribute data-produto of my input. $(".valor.partida").bind('blur', function(){ alert($(this).data("produto")); }); <script…
-
4
votes2
answers764
viewsQ: How to change the value of subsequent inputs?
In a form there are N occurrences of values for the same product, to facilitate I want to apply the same value to the subsequent inputs. For example, using the structure below: <input…
-
10
votes2
answers12794
viewsA: How to create a Mysql database with SQL commands?
The Mysql Workbench and the phpMyAdmin are only visual tools that offer convenience/ease in handling a database, SQL commands are independent of it. That way, assuming you are using some version of…
-
1
votes2
answers1228
viewsQ: Replace NULL with string
In a datetime field, when the value is NULL should only return -, tried the function IFNULL SELECT ISNULL(data, '-') as data FROM tabela but it returns me the error Microsoft OLE DB Provider for SQL…
sql-serverasked Marcelo de Andrade 7,261 -
5
votes1
answer435
viewsQ: How to display only the first row of a table?
I have a table with summaries about a particular client, where the first line is the main content to be displayed, and the rest is a mere complement. I know I could apply display: none, but I…
-
0
votes1
answer201
viewsA: How to run onChange in "masked" checkbox
I had to go through the elements and work with them in the following way: $('.iCheck-helper' ).click(function() { var input = $(this).prev(); var parent = $(this).parent();…
jqueryanswered Marcelo de Andrade 7,261 -
1
votes1
answer201
viewsQ: How to run onChange in "masked" checkbox
In a template, the following structure is automatically generated and $(".checkbox-newsletter").change(function() { alert('oi'); }); <script…
jqueryasked Marcelo de Andrade 7,261 -
0
votes1
answer70
viewsQ: How to "truncate" table to restart from the smallest auto increment value
To tabela_A has a field id auto increment. I need to clear the table with something similar to the command truncate only that cleaning only the record from the id = x. For example: id col1 1 A 3 B 4…
-
0
votes1
answer101
viewsQ: Insert apostrophes with variables
I am performing a query through a value stored in a variable. This variable is declared DECLARE @it_codigo varchar(max) and gets value from a field ntext from another table, through a previous.…
-
6
votes2
answers5894
viewsQ: How to display the status on a geochart?
I’m displaying a state-level geochart. When configuring with the region of Brazil works, as you can see below, but not with the state code, for example: BR-SP google.load('visualization', '1', {…
google-chartsasked Marcelo de Andrade 7,261 -
3
votes3
answers317
viewsA: How to delete whitespace around a given character?
If it is only to eliminate the space between the bars, use the str_replace. $str = "Comercial / Vendedor"; echo str_replace(" / ", "/", $str); Exit: Commercial/Seller See on ideone.…
phpanswered Marcelo de Andrade 7,261 -
0
votes1
answer43
viewsA: Replace datatable Labels in a Chart
The solution was to go through the dataTable returned by the API and replace the columns with the desired value.
-
0
votes1
answer43
viewsQ: Replace datatable Labels in a Chart
I’m populating a Area Chart from the datatable returned by Analytics API, but column Labels are populated with metric names ga:sessions, ga:pageviews,ga:goalsCompletionsAll, ga:bounces, etc.... The…
-
1
votes1
answer68
viewsA: How to get conversions per goal
The method must be called listManagementGoals of the Analytics API. /** * Example #1: * Requests goals for a single view (profile). */ try { $goals =…
-
0
votes2
answers6683
viewsA: How to order by the largest number of groupings, excluding those who have no more than one grouping?
Add the sort on SELECT among the parêtensis: select id, tipo from imoveis where cod = '$cliente' AND negociacao <> '0' GROUP BY tipo ORDER BY tipo DESC…
sqlanswered Marcelo de Andrade 7,261 -
0
votes1
answer208
viewsA: Doubt with DATEDIFF days interval between dates
Using the function Convert thus: REPLACE(CONVERT(DATE, @data, 103), '-','/') Then calculate the DIFF SELECT DATEDIFF(DAY,REPLACE(CONVERT(DATE, emissao, 103), '-','/'),REPLACE(CONVERT(DATE,…
sql-serveranswered Marcelo de Andrade 7,261 -
1
votes1
answer68
viewsQ: How to get conversions per goal
Working with API to handle data on conversion, I can get the total conversions per meta if I make explicit the API query parameter for metric, as follows: $metrics =…
-
2
votes2
answers54
viewsA: I have a QUERY that doesn’t display what I really need
Modifying your query, which I believe is being assigned to some variable before it is executed, try it this way: $sql = "SELECT id FROM clientes WHERE cliente = $cliente AND status = 2 AND tipo…
-
4
votes2
answers237
viewsA: How do I select only one element with a class that exists in other elements?
Selecting by the element index, you have the following options: $('.imagem')[index]; $('.imagem').get(index); $('.imagem:eq('+index+')'); Note: Remembering that the index starts from scratch.…
jqueryanswered Marcelo de Andrade 7,261 -
2
votes1
answer134
viewsA: Is Cakephp 1.3.15 compatible with Php 5.6?
According to the official documentation, version 1.3 requires only the PHP version >= 4.3.2 , that is, is compatible. With Daniel commented, do a prior check on a test environment, check the…
-
1
votes2
answers586
viewsA: Select All NULL and NOT NULL Records
To the work with NULL values in Mysql, use IS NULL and IS NOT NULL to verify this condition: WHEN LOJA_MEDALHAS.ID_MEDALHA IS NULL…
mysqlanswered Marcelo de Andrade 7,261 -
3
votes3
answers2223
viewsA: How to group for weeks using sql?
In Mysql, using the function week, can be done as follows: SELECT YEAR(dia) as ano, DATE_ADD(dia, INTERVAL(1-DAYOFWEEK(dia)) DAY) as semana, SUM(requisicoes) as total_requisicoes FROM tabela GROUP…
-
2
votes4
answers3541
viewsQ: How to bring records of a LEFT JOIN even if not obeying the WHERE?
Exemplifying, I have the tabela_A: cod nome 1 stack 2 overflow 3 stackoverflow and tabela_B: cod_tabela_A ano mes valor 1 2016 1 100 1 2016 2 115 2 2016 1 90 When made a LEFT JOIN, returns me the…
-
13
votes4
answers1072
viewsQ: What is the practical use of bitwise operators in PHP?
Operators bit by bit, used to manipulate specific bits, are somewhat unusual (not to say rare) their use in an application PHP. If we talk about escovação de bits in compiled languages, such as…
-
2
votes1
answer51
viewsA: How can I compare the attribute?
Assuming you are using a Gridview in Yii2. In the property value of column, you can use a closure and make the comparison: [ 'attribute' => 'gross_total', 'header' => 'SAÍDAS', 'value' =>…
-
1
votes1
answer47
viewsQ: How should the data of a table be selected through junctions?
When using the SELECT to obtain data from tabela_A by making a junction with the tabela_B, normally, and believing it to be the correct form, we use some of the commands JOIN. Ex: SELECT codigo,…
-
4
votes2
answers596
viewsQ: How to route Gmaps with shapes/polygons
I will need to manipulate a map ( preferably Gmaps ) containing the mesoregions of each state. I found a map of mesoregions created from Gmaps, but it doesn’t allow interactions like creating…
-
0
votes1
answer1241
viewsQ: How to concatenate variables
Dynamically, I am capturing the name of the columns where it appears in two tables to after this effect an Insert with table values_A in the tab_B. Using the resource CURSOR, I get the columns…
sql-serverasked Marcelo de Andrade 7,261 -
2
votes3
answers1432
viewsQ: Perform UPDATE with values from another table, in columns with the same name
I have the following tables table and table, These tables have about 20 identical columns. What I need to do is update the values of the tabela_B to start from the tabela_A, where the columns are…
sql-serverasked Marcelo de Andrade 7,261 -
2
votes1
answer122
viewsQ: How to use a variable across the scope of batch SQL
With the batch below, I want to remove duplicate records and after that UPDATE some values. The querys are in perfect order, but adding some error checks to the execution of the process, I came…
sql-serverasked Marcelo de Andrade 7,261 -
2
votes1
answer37
viewsQ: Why do update with join does not obey the WHERE conditional
I will replace the values of a column in table A by values in table B, being conditioned by a column in table C. When doing UPDATE, the condition is not being respected and all values are being…
sql-serverasked Marcelo de Andrade 7,261 -
3
votes1
answer83
viewsQ: How to perform an arithmetic operation without ordering it in GROUP BY
Having the following SELECT consulting a dynamic table from a subselect, I get the result of the query correctly but with records divided in the following example: cod_representante | ... |…
-
1
votes1
answer633
viewsQ: How to JOIN where the identifier could not be associated
I have the following query ready on an old system: SELECT regional, r.cod_gerente AS cod_gerente, u2.username AS nome_gerente, s.COD_REPRESENTANTE AS cod_representante, u1.username AS…
-
2
votes1
answer823
viewsQ: How to send Google Chart by email?
What would be a viable solution to send a Chart via email, via PHP? To get the Chart, I use it as follows: google.load("visualization", "1", {packages:["corechart"]});…
-
0
votes1
answer266
viewsA: How to get issues through the Redmine REST API
The API already returns a key/value with total results: $issues['total_count'];
-
1
votes1
answer256
viewsQ: How to load Google MAP Charts library
When trying to draw a Chart of type MAP, I get the following error: Uncaught Typeerror: google.visualization.Map is not a Function this occurs only with this type of Chart. <html> <head>…
-
0
votes1
answer266
viewsQ: How to get issues through the Redmine REST API
Using the API of Redmine using the wrapper of Kevin Saliou, I’m trying to get the issues of a particular project but is not being returned correctly, both issues open as to the closed are incorrect.…
-
3
votes1
answer524
viewsQ: How to create expression to allow just a few characters?
I am creating an input where an onKeyUp checks the entered characters, it should validate the following: No maximum number of characters The first digit should only be numbers [0-9] The code is…
-
2
votes1
answer209
viewsQ: How to construct the regular expression for the case?
I need to create an expression for the following case of a code field: No maximum number of characters The first digit should only be numbers [0-9] The code is composed of alphanumeric digits and…
regexasked Marcelo de Andrade 7,261