Posts by durtto • 3,109 points
104 posts
- 
		1 votes1 answer138 viewsQ: To remove characters to the right of a javascript string if it finds a certain characterA string called myString takes the value below: minhaString = 'O dependente DEPENDENTE não foi cadastrado. Erro: A coluna 'NOME' não pertence à tabela PFDEPENDCOMPL.… javascriptasked durtto 3,109
- 
		0 votes2 answers105 viewsA: How to create regex that only accepts characters without accentsI created a regex as follows: /[a-zA-Z ]/ 
- 
		0 votes2 answers105 viewsQ: How to create regex that only accepts characters without accentsOn my form html, I have the "name" field. In this field, I want to allow the field to accept only characters without accents. How to do this validation using Regex? I don’t want a function, I want… 
- 
		0 votes2 answers1067 viewsQ: How to detect a certain sequence of numbers in javascript?In the address registration field, I have the zip code. In this cep field, I need to make some validations: 1 - Do not allow the user to type a sequence with two alternating numbers: EX 1:… javascriptasked durtto 3,109
- 
		1 votes0 answers61 viewsQ: How to verify the existence of a given array in another array?At a certain point in my system, I need to consume a method that returns an array, which can contain arrays. I need to feed a second array with data contained in array leading. See example?… 
- 
		5 votes1 answer89 viewsA: Display data randomly from a databaseYou can use ORDER BY RAND() depends on your version: Laravel >= 5.2: User::inRandomOrder()->get(); Laravel 4.2.7 - 5.1: User::orderByRaw("RAND()")->get(); Laravel 4.0 - 4.2.6:… 
- 
		1 votes3 answers2769 viewsQ: How to know if the chosen date is less than the current date?I need to issue an Alert if the chosen date is less than the current date. I did so: var strData = "15/08/2017"; var partesData = strData.split("/"); var data = new Date(partesData[2], partesData[1]… 
- 
		1 votes1 answer94 viewsQ: Data javascript formatI was looking at the ISO8601 that talks about the format of string passed as argument for the date object. On this site, the date returned is yesterday. I’m passing the value '2017-08-03' to the… 
- 
		6 votes4 answers19332 viewsQ: Compare current date with javascriptI’m comparing today’s date to today’s date this way: if (new Date() > new Date('07/04/2017')) { alert('Hoje é maior que hoje?') } How can today be bigger than today?… 
- 
		3 votes4 answers8807 viewsQ: How to insert a property into a javascript object?I have the following javascript object: data2 = { "desColigada": "Empresa fulano de tal", "codMatricula": "00555454", "dataImpressao": "23/05/2016" }; I need to know how to insert this array into… 
- 
		0 votes1 answer108 viewsQ: How to know when a Thread has been completedI have the following implementation javascript on the call of a Thread. I would like to print in the log the moment Thread was finished. That’s possible? func4 = { run: function(){ atv4(); } }; r4 =… 
- 
		4 votes1 answer49 viewsQ: How do I use parse() in javascript?I have the following implementation: minhaDataRetornada = "Dez 20, 2016"; minhaDataTratada = Date.parse(minhaDataRetornada); console.log(minhaDataTratada); Running the above code, my return is :Nan.… 
- 
		0 votes1 answer1000 viewsA: Maven Settings.xml file not foundHere is the default directory: Assuming that you use Windows C:\Documents and Settings\{usuario}\.m2 You can also stay in this folder: ${maven.home}/conf/settings.xml… 
- 
		9 votes1 answer677 viewsQ: PHP works with cache?I am noticing that my application is occurring some error, or else my browser is always storing cache, even if I perform the cleaning. I have a file .php and in it contain the function loadEvent,… 
- 
		2 votes2 answers65 viewsQ: How to call a function that prints the name of the calling function?I have the following function: function imprimir(id, nomeFuncao) { console.log('id: ', id, 'Funcão que chamou: ', nomeFuncao) } I want the function imprimir() can print on console.log the… 
- 
		7 votes5 answers7032 viewsQ: How to return the sum of numbers of an array with indices of value greater than or equal to 2I have the following array: array[0,2,0,0]; I need to create a function that only adds indexes with a value greater than or equal to two, as I should proceed? In this example you must return me 2;… 
- 
		5 votes7 answers2833 viewsQ: How to check if at least one item of the array has value equal to or greater than 2I have the following array: array[0,2,0,0]; I need to create a function that returns me true if at least one array item has value equal to or greater than 2 
- 
		10 votes3 answers2010 viewsQ: How to optimize the sum of elements in an arrayI need to get the sum of the items of a array javascript. The quantity of these items can easily reach 2,000 items. The items are of the type int, no need to test. ar = [1,3,5,...,2000]; I already… 
- 
		4 votes3 answers1831 viewsQ: How to compare variables using Javascript?I use a lot of variable comparison. Example: if (item[l].item[0] == 'tipoRescisao') { log.info('Tipo Rescisão: ' + item[l].item[1]) if ( (item[l].item[1] == (1)) || (item[l].item[1] == 01) ||… 
- 
		1 votes4 answers11113 viewsQ: What kind is appropriate for field that saves hours in mysql?I need to save a field that saves hours in the database mysql. It’s a service record where I need to store the amount of hours of that particular service. When the service scheduling occurs at 11:00… 
- 
		0 votes1 answer1049 viewsA: How do I edit and delete data from a json file?You can do it this way: $users = json_decode($users, true); foreach ($users as $key => $value) { if (in_array('valor', $value)) { unset($users [$key]); } } $users = json_encode($users );… 
- 
		7 votes2 answers215 viewsQ: How to determine if a number is infinite using Javascript?There is the possibility to check if a certain value is a infinite number using Javascript? javascriptasked durtto 3,109
- 
		0 votes3 answers792 viewsA: How do Apache (wamp) stop killing the session by itself?Check whether your php.ini , has a value for Session.gc_maxlifetime (and also Session.cookie_lifetime ), which sets a limit on how long PHP will allow sessions to last. A solution is to check your… 
- 
		0 votes1 answer284 viewsQ: How to read return of a java functionI use a third-party Ged platform that provides web-services JAX-WS. There is a method called `getInstanceCardData that returns the value of the form record fields of a request. Follows the signature… 
- 
		3 votes2 answers2074 viewsA: Checking remaining days between current date and contact deadlineTry this $data_inicial = new DateTime($linha['data']); $data_final = new DateTime($linha['prazo_contato']); $diferenca = $data_inicial->diff( $data_final ); $diferenca = $diferenca->format('%d… 
- 
		2 votes1 answer61 viewsA: Is there any way to make an exception when fwrite cannot write?I could do something like this: > $resultado = fwrite('log.txt'); > if (false === $resultado) > { > throw new RuntimeException('Erro Especifico'); > }… 
- 
		21 votes3 answers866 viewsQ: What are "Magic Numbers"?My IDE informed that I am using magic numbers in my code, in the stretch f = 12. I’d like to know more about "magic numbers". I need to have a variable with a value of 12, but the IDE said something… encoding-styleasked durtto 3,109
- 
		3 votes3 answers4110 viewsA: How to get the first item of an object in javascript?The method Object.keys() returns an array of enumerable properties of a given object in the same order it is provided by a loop for...in (the difference is that a tie for-in lists properties that… javascriptanswered durtto 3,109
- 
		3 votes5 answers29127 viewsA: use if in sql serverELSE (IF... ELSE) (Transact-SQL) Imposes conditions on the execution of an instruction Transact-SQL. The instruction Transact-SQL (sql_statement) following the Boolean_expression will be executed if… 
- 
		2 votes1 answer578 viewsQ: After commit using Tortoise, unchanged folder iconAfter performing commit in a folder, the commit is successfully performed, but no icon change occurs after the process, continuing with normal windows folder icon. The error does not always occur.… 
- 
		-2 votes2 answers360 viewsQ: How to convert a date (string) to another format using Javascript?I have the following string: 2016-06-08 - 10:08 I need to convert this string to the other format: 08-06-2016 10:08 How should I proceed? function dateFormat(date) { inputFormat = new… 
- 
		2 votes2 answers2126 viewsQ: Access a function’s variable/parameter within another functionI have the following function: function criarDataset(field, constraint, sorFields) { totalTarefasAtrasadas = buscarTarefasAtrasadas(); function buscarTarefasAtrasadas() { usuario =… 
- 
		0 votes2 answers753 viewsA: How to extract values from fields of a javascript object (JSON)?You can use a loop and put everything in another array: var data = [{"nome":"Eduardo","cpf":"00.666.999-33"}, {"nome":"Paulo","cpf":"222.222.666-33"}]; var nomes = []; for(i = 0; i< data.length;… 
- 
		1 votes2 answers381 viewsA: Event button Fileupload with Submit Gmail stylejQuery uploadify plugin will load with a progress bar, and includes functionality for uploading single or multiple files. 
- 
		9 votes3 answers253 viewsQ: Is there a "in" comparator operator in Javascript?In Javascript there is a way to use in to check whether the value of a variable is contained in a list of values? A visual example: if (tipoDemissao in [1, 2, 5]){ valorDemissao = 525.20; }… 
- 
		2 votes3 answers319 viewsQ: How to disable console.log for a particular js file?I have many commands console.log in an archive regras.js. I wonder if there’s a way console.log only in this file, since commenting each console.log would be very time consuming, as it has many.… javascriptasked durtto 3,109
- 
		2 votes1 answer369 viewsQ: How to transform a Java String into a Java Array Object?On a . jsp page, I have the following code: String[] arrayRegioes = request.getParameterValues("numRegiaoUsuario");//objeto When I print the arrayRegioes, the value shown is:… 
- 
		2 votes3 answers182 viewsQ: Foreign value when printing arrayIn java, I’m having trouble understanding some concepts. On a . jsp page, I have the following code: String[] arrayRegioes = request.getParameterValues("numRegiaoUsuario");//object When printing the… 
- 
		3 votes1 answer66 viewsQ: What is the name of the resource/term that expands a code snippet between keys?What is the name of the resource that expands a code snippet between keys? I’m programming a file .jsp but the IDE does not identify the keys, so I cannot contract the code.… 
- 
		6 votes5 answers737 viewsQ: How to save data from a changed grid?My system has a grid with order items, coming from the dice. Well, I need to change the requested items, add one more item or even remove. You get the information in json and I’ll put it on the… 
- 
		2 votes4 answers832 viewsA: Create layout for PHP and . NET applicationsComplements the response of @bignow, you need to strategize and establish which tool pattern to use. You should ask yourself questions (and/or the team) about how to act, as there are currently many… 
- 
		1 votes1 answer1801 viewsA: Totvs Fluig - Customization - Call in REST service in beforeSendData eventI’ve turned your comment into an answer, so the question doesn’t go unanswered, and it can help other people. Take it as correct, if applicable. I made the corrections in the variable declarations,… 
- 
		0 votes1 answer57 viewsA: Magento installation for the 90%Check if there is a file called maintenance.flag in its Magento root. If it exists delete the file. 
- 
		0 votes2 answers2569 viewsA: Edit theme in WordpressYes it is possible. If after searching a lot for a theme you do not find the functionality you need, you will need to edit Wordpress theme that you acquire so that it manages to realize such… 
- 
		-3 votes3 answers8281 viewsQ: How to delete structure and data from mysql databaseHow to perform a complete deletion of a database structure mysql? I need to delete all the entidades, tabelas, procedures, I want to keep only the name of the database, without any table or data or… 
- 
		2 votes1 answer2162 views
- 
		3 votes1 answer367 viewsQ: What is the best way to accentuate words in . js files?There is a way to write words the way they are, with their accents? In php, just use: <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" /> In javascript, the word… 
- 
		0 votes4 answers1917 viewsA: Home Time in SQL (Years, months and days)SQL Creation of the Table CREATE TABLE [tablexemplo]( [DataAdmissao] [date] NULL ) ON [PRIMARY]; INSERT INTO tablexemplo values('2010-01-30'); INSERT INTO tablexemplo values('2010-02-28'); INSERT… 
- 
		10 votes3 answers13554 viewsQ: Convert object array to array arraysHow to perform string conversion (object array): [ {"id":1,"nome":"Maluf","cpf":"007.519.591-20"}, {"id":2,"nome":"Paulo Ricardo","cpf":"565.232.591-02"}, {"id":3,"nome":"Joaquim… 
- 
		6 votes5 answers56754 viewsA: What is the difference between syntactic error and semantic error?The errors of syntax. The compiler does not understand, for example, multiply a string with an integer number in C. The compiler will detect them because it cannot compile them. Semantic errors. The…