Posts by Lucio Rubens • 3,384 points
113 posts
- 
		1 votes1 answer36 viewsA: Copy URL to a column according to a criteriaYou need to check that the cell value is empty through the method getValue, for the activate returns an object. function geraURL() { var spreadsheet = SpreadsheetApp.getActive(); for (var i=2;… javascriptanswered Lucio Rubens 3,384
- 
		4 votes1 answer235 viewsA: Bug in code, function repeats calling when opening excel fileUse the Application.Caller, which returns the cell in which the function was called. Replace this excerpt: InsertPictureInRange LNumber, Application.ActiveCell For this: InsertPictureInRange… 
- 
		3 votes1 answer104 viewsA: Gradually increase a background-image from a pointUse the property transition for the progressive animation and bottom to position in the lower left corner: $('button').click(function() { $('p').css({ "width": "158px", "height": "158px" }); }); div… 
- 
		3 votes2 answers555 viewsA: Activate function on another page after clicking anchorYou can use the property .hash of the object Location, to capture/check if any anchor has been reported to the second page: Use the script in Pagina2: if(window.location.hash) { var hash =… 
- 
		2 votes1 answer47 viewsA: Join SQL SERVER SelectsYou can use the two options below, I would use the first option as it is the same table, thus avoiding unnecessary processing: CASE WHEN: SELECT COUNT(numero_parcela) as 'total_parcelas',… sql-serveranswered Lucio Rubens 3,384
- 
		2 votes1 answer1739 viewsA: How to use "Sync" from Laravel 5.1?The method sync() is available since version 4, and is used only in many to many relations (belongsToMany). This method is similar to attach(), follows explanation: attach(): Used to add a new… 
- 
		2 votes1 answer199 viewsA: Mask in imageOne solution is to use the image as the background of an element: .centro { width: 50px; height: 52px; background-repeat: no-repeat; background-size: cover; background-position: center center;… 
- 
		2 votes3 answers655 viewsA: How to use a dictionary value to call a specific Python function?According to that answer on Soen. Use: locals()["nomedafuncao"]() or globals()["nomedafuncao"]() In your case, it would be: locals()[menuOpt[1]]()… 
- 
		2 votes1 answer159 viewsA: How to get a specific version of a library via Nuget?Use the parameter Version: Install-Package iTextSharp -Version 4.1.2.0 
- 
		3 votes1 answer238 viewsA: Is it possible to change CSS in Webbrowser VB.NET?To capture all page elements: Dim todosElementos As HtmlElementCollection = WebBrowser1.Document.All And change the style: For Each elemento As HtmlElement In todosElementos elemento.Style =… 
- 
		2 votes2 answers49 viewsA: Open Direct Center PageIt is possible to direct to a specific element: http://www.minhapagina.com/#centro That is, when entering the main page, just redirect to the same address by adding # + id of the element!… 
- 
		2 votes5 answers142 viewsA: what is the best way to create elements?With jQuery you can create the element to define its attributes dynamically as follows: $('<button/>', { class: 'btn btn-danger btn-info-bloco form-control', name: 'btn-login', text: 'Login'… 
- 
		0 votes2 answers142 viewsA: Error reading position (3) of Two-dimensional array: Invalid argument supplied for foreachThe problem is that your item key is not an index, replace: $detail[3] That’s why: $detail["Atividades"] 
- 
		1 votes2 answers1562 viewsA: Filling form dynamics with AngularjsTo fill in the value according to the model, just use the directive ngModel: <input type="text" ng-model="contratos.cep" /> <input type="text" ng-model="contratos.cidade" /> Remembering… 
- 
		3 votes2 answers1271 viewsA: Mount array through a list in ajaxSupposing the return of your webservice is something like: response = [ {"Id": 1, "Valor": "10.000", "Cor": "Azul"}, {"Id": 2, "Valor": "15.000", "Cor": "Verde"}, {"Id": 3, "Valor": "12.000", "Cor":… 
- 
		3 votes1 answer201 viewsA: Pick up selected Radiobuttons in WPFYou can use the event Checked: <RadioButton Name="radioButton1" Checked="radioButton_Checked">Opcao 1</RadioButton> <RadioButton Name="radioButton2"… 
- 
		2 votes2 answers9412 viewsA: Codeigniter . htaccess remover index.phpYou should put out of any folder, ie at the root of the framework: application/ assets/ system/ .htaccess index.php Then change the file application/config/config.php: $config['index_page'] =… 
- 
		2 votes1 answer444 viewsA: How to manipulate the DOM through an extension?You need to use Content Scripts. See a basic example: manifest.json: { "name": "Exemplo StackOverflow", "description": "Demonstração de como utilizar content_script", "version": "0.1",… 
- 
		4 votes1 answer265 viewsA: Show last results but with ASC sorting in PHPUse a sub-query: SELECT * FROM (SELECT * FROM teste WHERE categoria = 'cateste' ORDER BY id DESC LIMIT 10) S ORDER BY id ASC 
- 
		0 votes3 answers3464 viewsA: Average between 3 direct dates in sqlserver bank?Assuming your table contains a primary key: select sum(c.diff)/2 as total from vendas v1 inner join (select top 3 id, data from vendas order by data desc) v2 on v2.id = v1.id-1 cross apply ( select… 
- 
		2 votes1 answer1026 viewsA: Txt file directory with VBSYou can capture the current directory through the object Scripting.Filesystemobject: Dim oShell, oFso Set oShell = Wscript.CreateObject("WScript.Shell") Set oFso =… 
- 
		3 votes2 answers1412 viewsA: List Tree Categories in Laravel 5.1In the relationship lacked only specify the relationship column: class Categoria { public function categoriaPai() { return $this->belongsTo('App\Categoria','categoria_pai'); } public function… 
- 
		3 votes1 answer41 viewsA: Creating a single functionFrom what I understand you want to check if any item on the list matches google.com: $hosts = 'paste2.com = Mega,meohost.com = Meo,google.com = gdriver'; foreach(explode(',', $hosts) as $item) {… phpanswered Lucio Rubens 3,384
- 
		2 votes1 answer165 viewsQ: Time calculation logged in to SQLI have a system where user logs in and drops the tool several times a day during their work hours. I need to calculate the amount of time it was logged in: The columns LOGOUT and LOGIN are in… 
- 
		5 votes2 answers522 viewsA: Recovering value in the pivot table as property of a relationship partAccording to the documentation of the Laravel, you need to add withPivot in their relationship: return $this->belongsToMany('App\User', 'grupo_usuario', 'grupo_id',… 
- 
		2 votes1 answer53 viewsA: SQL Server joining tables with nullYou need to use the LEFT JOIN, read more about in that reply. SELECT Responsavel.Id Responsavel.Nome, Filho.Nome FROM Responsavel LEFT JOIN Filho ON Responsavel.Id = Filho.ResponsavelId… 
- 
		2 votes1 answer1611 viewsA: Take the value of a li and create an Hidden input with the value when the li is clickadaThe idea is the same as mine reply in your other question. You only need to assign the function to the event click(): $("#selecao .active").click(function() { $('<input/>', { type: 'hidden',… 
- 
		0 votes1 answer228 viewsA: How to make a div of equal height to the div container? (container larger than viewport)Add the following property to your class .conteiner: .conteiner {position: relative} For the Divs that will expand according to the content (left and right): .expandir { position: absolute; height:… 
- 
		1 votes1 answer737 viewsA: Handle jQuery array objectsYou need to create the element and add to form: $(function() { $('#selecao .active').each(function() { $('<input/>', { type: 'hidden', name: 'selecao[]', value: $(this).val()… 
- 
		1 votes1 answer1068 viewsA: Error save field type data null, not set field as notnullYou need to replace the empty variable with the NULL string: $dtnasc = 'NULL'; 
- 
		2 votes2 answers6866 viewsA: Fix and change color in menu depending on scrollYou need to use the event scroll of the object window, and the method scrollTop to capture the position: $(window).scroll(function() { var scroll = $(window).scrollTop(); if (scroll > 500) {… 
- 
		1 votes1 answer1063 viewsA: How to extract a SFX file with 7zip in command line?7za supports only 7z, lzma, Cab, zip, gzip, bzip2, Z and tar formats. One Issue has already been opened in the official repository.… 
- 
		2 votes2 answers787 viewsA: How to loop with input select PHP?By the description of the problem, you need to check if the selected city belongs to your list of cities. For this use the functions array_map() and in_array(): $interesse =… 
- 
		2 votes2 answers2051 viewsQ: Merge two distinct lists using LINQI have two classes, Cliente and Endereco, where the client has 1 or more addresses, so it is a list of objects: class Cliente { public string Nome { get; set; } public string Cpf { get; set; }… 
- 
		2 votes2 answers94 viewsA: How to adapt code to mysql_The similar function for mysqli, is the real_escape_string: $generos_escape = $mysqli->real_escape_string($submedia["genero"]); $generos = array_map('trim', explode(',', $generos_escape)); Then… 
- 
		3 votes3 answers442 viewsA: Date 01 day of the month returns as lastThis is because javascript is converting the date to the current time zone. See that the end of the first alert ends with GMT-0300: Wed Dec 31 2014 21:00:00 GMT-0300 (Hora oficial do Brasil) That… 
- 
		2 votes1 answer159 viewsQ: Apply function to all list elements using VB.NETIs there a function/module for an object of type List in VB.NET that is similar to array_map() of PHP? The idea is to create a new variable with the elements that satisfy a certain condition. I have… 
- 
		1 votes1 answer107 viewsA: How to make an element return as it was after an action with jqueryUse the method clone(), creating a copy of the element. var elementoOriginal = $("#box").clone(); $("#btn-remover").click(function() { $("#box").css('background','yellow'); });… jqueryanswered Lucio Rubens 3,384
- 
		0 votes1 answer48 viewsA: Function upload multi attchementsThe obejeto FileDialog is provided by the library Microsoft Office [Nº da versão] Object Library. Probably the reference has not been defined or is corrupted. To activate: Editor VBA >… 
- 
		2 votes2 answers328 viewsA: Commit using PHPAccording to the documentation, to deactivate the autocommit: $conn->autocommit(FALSE); Example of use: $conn->autocommit(FALSE); $mysqli->query("INSERT INTO Language VALUES ('DEU',… 
- 
		0 votes1 answer120 viewsA: Install Mahapps.Metro on a Windows ApplicationAs reported on slogan page, is only for WPF! Mahapps.metro to UI Toolkit for WPF So no, cannot use with Windows Forms. c#answered Lucio Rubens 3,384
- 
		8 votes2 answers4434 viewsA: Adding numbers from a Mysql column using PHPFirst you need to connect to your database through the extension MySQLi, documentation here. Once done, just run a query using the function SUM() mysql: $mysqli = new mysqli('localhost', 'usuario',… 
- 
		2 votes1 answer1916 viewsA: Test connection to the databaseAccording to that answer in Soen: Disable automatic database startup: $db['autoinit'] = FALSE; To avoid surprise errors, disable debugging: $db['debug'] = FALSE; Use the function initialize() to… 
- 
		4 votes8 answers794 viewsA: Mapping an array with possible subarrays as elementsTurn the multidimensional array into a string, then turn it into an array: var array = [1,2,3,4,5, [1,3,2,4,1]]; console.log(array.join().split(",")); // ["1", "2", "3", "4", "5", "1", "3", "2",… 
- 
		2 votes1 answer892 viewsA: Import CSV files to Mysql using LOAD DATA LOCAL INFILEThe keyword LOCAL is used when the file is on another machine than Mysql is running. By adding the LOCAL the file will be sent to the server, stored in a temporary folder, and run from there. This… 
- 
		3 votes3 answers11070 viewsA: BATCH SCRIPT - Automating website loginAnother alternative would be to use tools such as Autoit or Autohotkey which are automation languages for the Windows system and have various features to simulate a user interaction. Follow example… 
- 
		1 votes2 answers601 viewsA: Change time and end date according to startvar entrada = document.getElementById("txt-entrada"); var saida = document.getElementById("txt-saida"); function adicionarHora() { // converte string em data var data_entrada = moment(entrada.value,… 
- 
		0 votes2 answers490 viewsA: Error installing Visual Studio 2013 CommunityVisual Studio 2013 works only on machines with Windows 8 or Windows Server 2012 installed. See detailed table here. Use Visual Studio 2012, which is compatible with Windows 7.… 
- 
		4 votes2 answers2774 viewsA: Mysql - make each row increment 1To avoid the declaration you can use the variable as a table: select @num := @num + 1, u.usu_nome from tab_usuario u, (SELECT @num := 0) as t group by u.usu_id;… 
- 
		3 votes2 answers199 viewsA: Can I open a dll extension without entering php.ini?Command line: The parameter -d is used to set values in the file .ini: php -dextension=php_openssl.dll Running time: This function has been removed since version 5.3 To load the extension at… phpanswered Lucio Rubens 3,384