Posts by Guilherme Lautert • 15,097 points
356 posts
-
8
votes3
answers464
viewsQ: IDE - Divergence between Ides relative to tab [to Enter]
On grounds of hadware, I am the only one in my team that is using Sublime Text 3, the others are using Eclipse Luna or Mars, until there is nothing more. However since the exchange I’ve had some…
-
2
votes1
answer159
viewsQ: Regex - Very high replace process time
Recently after developing a process, I saw that this was taking exorbitant 5~6min to be executed, something that should take at most 2s, so I started debugging the code with timers to know what…
-
0
votes2
answers62
viewsA: How to use User-informed search conditions ( Not required )
SQL CREATE TABLE tb_teste( cd_pedido INTEGER, cd_seq_pedido INTEGER, cd_marca INTEGER, cd_tipo INTEGER ); Prominently define your inputs with the column name in the table HTML <form…
-
1
votes1
answer79
viewsQ: Http request - log
I am developing a Curl process, and for this I am checking the pages necessary to manage the urls. However there is a page that performs Http Request 302 (redirect), and I’m unable to capture it as…
-
1
votes1
answer371
viewsQ: Linux - Symolic Link + Dropbox
I am making use of the sublime 3 recently and would like to leave it standard on all my computers. For this I thought of using Dropbox, which automatically synchronizes in case of any changes. I…
-
2
votes0
answers256
viewsQ: SVN - Sublime Text 3
I’m using Sublime Text 3 for development and I need a good SVN. I’m currently using the SVN, however the system of comparison of his files did not please me much, I also found the Sublimerge, This…
-
4
votes3
answers316
viewsA: Opensuse 13.2 - Sublime as standard editor
As I told in the comments with @Sneepsninja, I found the solution performing some tests on .desktop in usr/share/applications/. I noticed that the only difference between the files : skype desktop.…
-
0
votes3
answers366
viewsA: Get URL paths
Try to adapt this way: $scope.visualizar = function (id, host){ var r = null; if(typeof(host) != undefined){ r = new RegExp(host+'/api/[^/]+/(.+)'); }else{ r = new…
-
1
votes2
answers92
viewsA: Problem with INNER JOIN
You are using a SELECT within another SELECT or be a sub-SELECT. In this case your return from sub-SELECT must return a single column, or else you must use a function so that the data becomes a…
-
0
votes4
answers7700
viewsA: Sort a multidimensional array by a column, keeping the same lines of the array
$arrayTeste = Array( 'sites' => Array( 0 => '', 1 => '5 Estacao', 2 => '3 Estacao', 3 => '4 Estacao', 4 => '1 Estacao', 5 => '2 Estacao', ), 'IPs' => Array( 0 => '', 1…
-
1
votes2
answers233
viewsA: Javascript Date
Try a function function IntToDate(i){ var d = new Date(i); return moment(d.toUTCString()); } IntToDate(1424102400000).format('DDMMYYYY'); I quickly looked at the doc’s momentjs, whether it is…
-
1
votes1
answer122
viewsA: Change the access url to ip in htacess
Try. Options +FollowSymlinks RewriteEngine on RewriteCond %{REMOTE_ADDR} ^10.108.105.59 RewriteRule ^.*$ http://site.dev [L]
-
0
votes4
answers3411
viewsA: Set generic "date - * " attributes with javascript;
I’ve developed an extension for jQuery that might help. (function(jQuery) { jQuery.fn.attrData = function(k, v){ var attrs = jQuery(this[0].attributes); var attrsData = attrs.filter(function(index){…
-
1
votes2
answers1417
viewsA: Jquery and PHP POST method
ARQUIVO JS var valor = jQuery('button.active').val(); jQuery.ajax({ url : "alterar.php?Key="+valor, dataType : 'json', async : false, success : function(msg)…
-
0
votes1
answer513
viewsA: Google Chart - Showing different dates
Solution Alternative 1: The date shall be specified by parameters : new Date(2015,05,01). Note that the months go from 0 to 11 being January - December. Alternative 2: The date shall contain…
-
1
votes1
answer513
viewsQ: Google Chart - Showing different dates
I’m developing some test with the google Chart API. And I’m having a somewhat peculiar problem. Code data = new google.visualization.DataTable(); data.addColumn({ type : 'date', label : 'Day' });…
-
6
votes1
answer305
viewsQ: String para Date
I’m creating some parsers and was doing some tests to develop Date’s. This code: value = '2015-12-31 23:16:00' value = value.replace(/(\d{4}-\d{2}-\d{2}) ?(\d{2}:\d{2})?(:\d{2})?.*/, '$1T$2$3');…
-
2
votes1
answer436
viewsA: Encapsulation, Functions - String function call
Solution until the moment: var f = {}; f.parseNumber = function parseNumber(value){ return parseFloat(value) || 0; } f.parseString = function parseString(value){ return ''+value+''; } f.parseBoolean…
-
2
votes1
answer436
viewsQ: Encapsulation, Functions - String function call
I’m having a problem checking if a certain function exists. Code - Similar. if(jQuery){ (function(jQuery){ jQuery.extend(jQuery.fn, { exemplo: function(o){ var chartError = false; function…
-
2
votes1
answer222
viewsQ: Java - String - Comparison
I’m not getting a simple comparison I’m making, but it’s not performing like I think it should. Situation I request that the user type the person’s name, and capture with String nome = scan.next();…
-
2
votes1
answer118
viewsA: PHP - Array - Horizontal Keys
Good to solve my problem I set up this function, it’s been a while since I just posted it. She works with the idea I want, but is limited to array monodimentional, that is if anyone else wants to…
-
3
votes2
answers367
viewsA: Regex in dynamic string X characters, in dynamic content
As @Papacharlie commented you can use {N} to delimit the exact number of characters of wish. As for regex: You can use the auxiliary \w which it rightly represents a-zA-Z0-9_ preg_match(…
-
4
votes1
answer118
viewsQ: PHP - Array - Horizontal Keys
Situation I own an array as follows: Array ( [1] => Array ( [tree] => Array ( [tb_agenda_hora] => 2, [tb_agenda_fase] => 1, [tb_agenda] => null ) ) [2] => Array ( [tree] =>…
-
6
votes3
answers316
viewsQ: Opensuse 13.2 - Sublime as standard editor
I downloaded the sublimeText2 for text editing and would like to define it as the default editor instead of the gedit but I’m not getting it. Attempts Arquivo -> abrir com -> outro aplicativo…
-
0
votes4
answers685
viewsA: Error in JSON PHP return to AJAX
I don’t know what your sendmail function does, but your html is so : $msgSend = ' <h3 style="font:16px Arial, Helvetica, sans-serif; color:#000;"> Contato recebido através do site…
-
0
votes1
answer76
viewsQ: Shortcuts - Opensuse 13.2
I want to develop shortcuts in linux Opensuse 13.2. I wonder how I can make that by squeezing super+e he opens the arquivos. I know that to do it I need to go in…
-
2
votes2
answers208
viewsQ: Merge linux commands - rm and diff
I’m learning to use Linux with Opensuse IDE version 13.1. I wonder if it is possible to merge the commands rm -r with diff - r? Goal Remove the files 1.txt,2.txt,2.txt of path1, because it does not…
-
14
votes2
answers2102
viewsQ: int and Integer - Java
I’m developing a project in Java and he’s in error, I’ve found it but I don’t understand it. public class Time{ private String nome; private ArrayList<Jogador> jogadores; private Integer gols;…
-
3
votes8
answers17275
viewsA: Difference between while and for
First to know how to distinguish the two you need to know what their elements: For for (expr1; expr2; expr3) statement expr1 = Executada uma vez incondicionalmente no incio do ciclo expr2 = Avaliado…
-
8
votes1
answer1006
viewsA: New row in table every 3 columns
<table border="0" width="650"> <?php $i = 1; echo '<tr>'; while($data2 = mysql_fetch_array($SQLContentCalendario)){ echo '<td valign="top" width="200">'; ... echo '</td>';…
-
0
votes2
answers635
viewsA: How to split a string with delimiter in PHP?
$str = "1b00bd515bf8cbc5a86f3b714361fab6"; print_r(preg_replace('/(\w{8})(?=\w)/', '$1-', $str));
-
7
votes1
answer198
viewsQ: Reduced ternary in PHP - Error or misinterpreted?
Looking at the manual we have this description: 'The Expression (Expr1) ? (expr2) : (expr3) evaluates to expr2 if Expr1 evaluates to TRUE, and expr3 if Expr1 evaluates to FALSE. Since PHP 5.3, it is…
phpasked Guilherme Lautert 15,097 -
5
votes2
answers328
viewsA: How to swap a string with jQuery?
Similar to @Ricardo’s only function. <script type="text/javascript" src="jquery-1.11.0.js"></script> <img id="imgRotate" src="/kit_150x150-12por-238x238.png"> <script>…
jqueryanswered Guilherme Lautert 15,097 -
0
votes2
answers283
viewsA: Regexp does not take input value
I also recommend using the DOM library but prefer to use this. Now in case you want to rat out the attempt to ER, try: Example $id = 'X-Tmx-session-id'; $pattern =…
-
1
votes2
answers468
viewsA: Regular expression problem in . htaccess
From what I know the mode RewriteRule he converts the GETs of ?= for / In my tests, the reason it’s not working is that the expression : RewriteRule ^first-login/([a-zA-Z0-9]+)?([0-9]+)$…
-
1
votes1
answer86
viewsA: Multi Sql Begin, database data protection
Solution I have created methods that will execute the BEGIN;, COMMIT;, ROLLBACK; Example function begin(){ $this->Execute('BEGIN;'); } function commit(){ $this->Execute('COMMIT;'); } function…
-
2
votes1
answer73
viewsQ: Which errors trigger the catch?
In a test similar to this, I was in doubt of what mistakes generate the Exception. Researching I only found explanations of the use of try, catch, and some references that this would depend on the…
-
1
votes1
answer86
viewsQ: Multi Sql Begin, database data protection
In my application I use BEGIN;, COMMIT;, ROLLBACK;, Try, Catch: Example: try{ $this->execute('BEGIN;'); // CODIGO COM VALIDAÇÕES $this->execute('COMMIT;'); }catch(Exception $e){…
-
1
votes5
answers26812
viewsA: When is isset required?
Ah some time implement this function : /** * campoNecessario * * Realiza uma verificacao no(s) campo(s) passado(s), que retorna "true", * caso esteja "empty", o "empty" tambem considera valor "0"…
-
-1
votes2
answers291
viewsQ: Variable name passed in function argument
Situation I’m willing to develop this function function ve($var, $dieAfter = false){ $nomeDaVar = ????; echo '<pre>'; echo '$'.$nomeDaVar." = "; var_export($var); echo '</pre>'; if…
-
0
votes2
answers1288
viewsA: replace using regular expressions
As requested: (\d{3})(\1)(\1)(\d{2}) Composition (\d{3}) - grupo nº 1 (\1) - grupo nº 2, que utiliza a mesma expressão do grupo 1 (\1) - grupo nº 3, que utiliza a mesma expressão do grupo 1 (\d{2})…
-
15
votes1
answer1791
viewsQ: How to apply Dexes to improve the performance of the queries?
I’m looking to increase the performance of my database, which has over 1 million records. Research I have undertaken Sobre index link1 Cluster-wise link1 Link2 Doubt The idea of cluster it seemed…
-
0
votes7
answers9711
viewsA: Remove accents
Some time ago I developed this solution for my PHP environment, function changeLetters($string, $down = true){ $letters = array(…
ranswered Guilherme Lautert 15,097 -
1
votes3
answers400
viewsA: Problems with regular expressions (friendly url)
I don’t know if it’s useful to you, but here is an expression to search only the parameters passed from the url, I didn’t run tests with multiple urls just the one you passed. Regex…
-
2
votes2
answers269
viewsA: Regular Expression does not work correctly on webform
Situation The reason why the password 1q2w3e4f5t6y7u8i not this working is the following, in your ER you have: (?=.{8,}) // ate aqui ok, você limitou a ter pelo menos 8 caracteres [a-zA-Z]+ // uma…
-
0
votes1
answer2130
viewsQ: XY position in C, repositioning
I am in need of the current "cursor" coordinates of the screen, for the user to remain in the current line. EXAMPLE void main{ char nome[50]; char sobrenome[50]; int linhaAtual; linhaAtual = ????;…
-
3
votes2
answers127
viewsA: Regular expression to create a line of a cock game (tic-tac-toe)
Recalling that the | is a special character in regular forms and represents the or to capture you literally you must use \| With this expression I believe you can find what you want. \|\s+(o|x|…
-
1
votes2
answers1446
viewsA: Remove String Connectors with Regular Expression
Following @Mateus Alexandre’s reply: You can use the following pattern as well: String padrao = "\s(e|d(a|e|i|o|u)s?)\s"; This pattern was divided into two groups, these follow the order: space +…
-
8
votes2
answers209
viewsQ: Processing time is affected by the size of variable names?
I was analyzing some frameworks developed by large companies and noticed a certain uniqueness, its variables and functions usually have small names. Variable or function name size interferes with…
-
7
votes1
answer767
viewsQ: Change of char variable content
I’m having trouble working with files and handling char. CODE char *fileTipoDespesaDefault; char *fileTipoPagamentoDefault; FILE *fileTipoDespesa; FILE *fileTipoPagamento; /** * tipos : 1 =>…