Posts by Zuul • 35,190 points
501 posts
-
2
votes2
answers115
viewsA: Line misalignment
Your problem is the fact that every element with the class col-sm-4 or any other col-X is floated to the left as it is the form in which the framework works the columns. For HTML the solution is to…
-
3
votes2
answers213
views -
7
votes2
answers2312
viewsA: Scan the machine/server using php
There is an interesting project on Github that allows us to get a "universe" of information about the system: phpsysinfo A great advantage is the support we get because the project is tested in…
-
4
votes2
answers143
viewsA: Class is not embedded in DOM(Jquery)
You are adding the class and then removing the class. In the DOM notes that the attribute class is added but empty because jQuery adds the class to the element where to apply the attribute class but…
-
4
votes2
answers167
viewsA: Use substr directly on a foreach
My solution would be to make use of the function wordwrap() to collect X characters, passing the result to the function explode() to break the output in lines and finally stay only with the first…
-
3
votes1
answer381
viewsA: Generate Qrcode from a file
PHP QR Code PHP QR Code is an open source library (LGPL) for generating QR Code images. Based on libqrencode C library, provides an API to create QR Code barcode images (PNG, JPEG thanks to GD2).…
-
5
votes2
answers3812
viewsA: Send form data via GET to server (without updating page)
By making use of an AJAX call using jQuery to facilitate our work, we can handle the issue by making use of the function $.ajax() as follows: var dadosFormulario = $("#formulario").serialize();…
-
3
votes3
answers2537
viewsA: Detect no characters in a string
"Regular" ASCII characters span from hexadecimal 20 at the 7F: Image credits for Wikimedia Commons. Therefore, a practical method is to check that all characters in the string are within this ASCII…
-
1
votes1
answer115
viewsA: Chrome auto page scrolling to select Multiple with selected option
As of today, after updating Google Chrome browser to version "39.0.2171.95 m" running on Windows 8.1 64bit the problem is no longer verified. Back then, to get around the bug present in the version…
-
11
votes2
answers22530
viewsA: How to capture a photo through the user’s webcam and send via POST?
There is a very interesting project on Github to provide a current solution for the client’s webcam usage, making use of Flash fallback in older browser cases: Webcamjs Webcamjs is a small (~3K…
-
3
votes2
answers1475
viewsA: Store var_dump in a variable
The correct function is the print_r() because it accepts a second parameter to pass the output instead of doing the dump of the same: Example: $b = array ('m' => 'monkey', 'foo' => 'bar', 'x'…
-
4
votes1
answer2472
viewsA: Function is not running when page loads
Your code works perfectly, see the example below: var main = function() { 'use strict'; alert("Hello World!"); }; $(document).ready(main); <script…
javascriptanswered Zuul 35,190 -
6
votes3
answers134
viewsQ: Prevent script from following symbolic links
With the script below, a search is carried out for all the accommodations in the indicated directory in order to obtain the email addresses associated with each accommodation: #!/bin/bash # Scan All…
-
4
votes2
answers468
viewsA: Remove all tags inside a contenteditable
One solution is to use a regular expression to remove all HTML tags except the <br> or <br/>: var texto = "<b>Olá</b>, Usuário<br><i>Seja bem vindo</i>!";…
-
2
votes2
answers749
viewsA: Capture div by class
Your problem seems to me to be the way you’re passing the name of class to be located: $html = '<div>Ora que raio!</div> <p>Ola meu nome é pseudomatica (sou normal), etc. Meu nome…
-
4
votes1
answer1190
viewsA: How do I make a <div> close when it’s clicked off?
To close the element when a click occurs outside of it, you have to be aware of some things: Click was outside the element; Click was not on the button that controls the element; Click was outside…
-
5
votes2
answers204
viewsA: Scan source code and find wikipedia url
Given the URL does not contain the character ? which is the denotation of the beginning of query string, a simple way is by making use of a regular expression that will remove everything after the…
-
9
votes4
answers9657
viewsA: How to open a <div> by clicking on a <a> link?
To display or hide an element based on the click of another we will need to use two methods: jQuery .on() to execute code when the button receives a click. jQuery .slideToggle() to animate the…
-
3
votes1
answer608
viewsA: Difference between glFlush and glFinish
Opengl commands are not executed immediately. Instead, they are subjected to a buffer command which is then fed to the hardware. The commands glFlush() and glFinish() are both used to force the…
-
11
votes1
answer1925
viewsA: How to request a trial in the java android app?
No, normally a user using Android is already logged in to the device, you will not have to re-log in to evaluate an application. Request evaluation of the application There is no "best way" because…
-
6
votes1
answer1582
viewsA: ip camera streaming
There is a MJPEG stream acquisition processing library of IP cameras made in Java for this purpose: ipcapture package ipcapture; import java.net.*; import java.io.*; import javax.imageio.ImageIO;…
-
4
votes1
answer622
viewsA: Problem passing parameters to function
Your problem is in the scope of the function and some variables that need to be declared globally. How you got it all inside the box $(document).ready(function() { /**/ }); your event onClick does…
-
2
votes1
answer333
viewsA: Sqlitedatabase turn back into json
Well, you can’t use it for that execSQL (String sql): execSQL(String sql) Run the single SQL statement that is NOT a SELECT or any other SQL statement that Returns data. That translated:…
-
10
votes4
answers6464
viewsA: Insertion of a dot every 5 characters
A solution is the function chunk_split() which serves precisely to divide the string in smaller pieces: $str = chunk_split("AAAAABBBBBCCCCCDDDDD", 5, '.'); Example in Ideone: var_dump($str); //…
-
6
votes2
answers131
viewsA: Capture and filter result
Take the value of the first <p/> One practical way is to take this HTML and generate a DOM of it through the PHP class Domdocument: $html = '<div></div> <p>Ola meu nome é…
-
3
votes4
answers453
viewsA: Get most used words from a string
Essentially, it will be necessary to break the text into words for an array. Then we need to count the repeaters, order the result of the highest number of repeaters for the lowest number of…
-
4
votes1
answer1179
viewsA: jQuery Datatables numerical column sorting containing hidden HTML
In fact, sorting is based on the contents of the cells, so even hidden, the HTML present in the cell will make it impossible to sort it numerically. The solution in these cases is to create an…
-
4
votes1
answer1179
viewsQ: jQuery Datatables numerical column sorting containing hidden HTML
Making use of jQuery Datatables, we can indicate the type of ordering sought: $('#example').dataTable( { "aoColumnDefs": [ { "sType": "numeric", "aTargets": [ 0 ] } ] }); But if HTML is present,…
-
1
votes1
answer141
views -
4
votes3
answers3898
viewsA: How to 'break' a text at each character range - Javascript
A solution making use of the method match() with a regular expression: var teste = '1234567898'; alert(teste.match(/.{1,8}/g)); // Devolve: 12345678,98 console.log(teste.match(/.{1,8}/g)); //…
-
10
votes4
answers8045
viewsA: Create button with icon next to
From my experience with Bootstrap, the best way forward tends to be to use the classes already provided by the framework, with additional formatting to get to what we want. Formatting of the…
-
4
votes4
answers420
viewsA: CSS, firefox input shows blank text
Your problem, as stated by bfavaretto is the fact that you are telling the browser that the text box size should contain the padding and the border: box-sizing: border-box; This is causing the input…
-
5
votes2
answers2674
viewsA: How to work with Base64 encryption in Mysql?
Mysql >= 5.6.1 In Mysql, encoding or decoding in BASE64 is only possible from version 5.6.1. Previous versions give the following error: #1305 - FUNCTION impor_website_2014.TO_BASE64 does not…
-
6
votes3
answers546
viewsA: Simulate placeholder in IE8
There is a project at Github to address this issue: Placeholders.js - An HTML5 placeholder attribute polyfill To use it, it’s as simple as including the Javascript file on the page: <script…
-
2
votes3
answers179
viewsA: CSS, center split line between left and right
A solution is to make use of the CSS property box-sizing where we can indicate that we want the width of the elements to include padding and border: box-sizing:border-box; In this way, we can give…
-
9
votes3
answers1750
viewsQ: Smooth element animation swing via CSS Transform
The concept being sought is the continuous motion on the X axis between a value and its negative representation: So far, this concept has a flaw, the animation is performed from 0 degrees to the…
-
3
votes2
answers3860
viewsA: Grab a value inside the HTML Curl
Assuming you’re using Curl to pull the HTML from an address, and then use PHP to collect certain collected HTML data: You can use the class DOMDocument to do the parse HTML, find the tag <a/>…
-
7
votes3
answers254
viewsQ: Why validate even with a default value
When I’m preparing something, however simple it may be, the question always arises: I must trust the mine code? This puzzle is usually associated with the fact that "tomorrow" may not be me…
-
4
votes0
answers1298
viewsQ: Gammu CMS Error 500: "Unknown error"
By sending Smses using the Gammu, for some numbers that are active and running I get the following error: Array ( [0] => 4 / 0 [1] => Sending SMS 1/3....waiting for network answer..error 500,…
-
19
votes2
answers234
viewsQ: How to reference the current board
As an example, using the variable SCRIPT_FILENAME we can get the requested file, but for this problem we want to get the directory where the file is .htaccess: # Rewrite the url <IfModule…
-
12
votes1
answer191
viewsQ: Is the appropriate type to serve Javascript "text/javascript" or "application/x-javascript" or "application/javascript"?
When analyzing the source code of several pages, it can be seen that the Javascript headers vary with regard to the mime (English) indicated, but the doubt remains about which we should effectively…
-
3
votes4
answers714
viewsA: Trying to condense conditional with three possibilities
All answers deal perfectly with the problem, including some solutions in the question. I am going to leave a suggestion that is very much in line with what has already been pointed out in some…
-
3
votes2
answers91
viewsQ: Refine article ranking based on views of all articles
The idea is to ascertain the reputation of a particular article based on the views of all existing articles. An article can have a reputation of 1 to 5 stars, the same being constantly changing…
-
2
votes1
answer39
viewsA: Configuration of XML
Yes, your example is correct: motorBD://<utilizador>:<password>@servidor/<nomeBaseDados> Example: <dsn encoding="UTF-8">pgsql://postgres:postgres@localhost/gisdb</dsn>…
-
7
votes1
answer612
viewsA: Connect and disconnect Internet?
Note: The question was edited and they tagged c++ for batch. But the purpose of the question is an answer in c++. At the time of this reply the tag was in batch, and a solution via batch. I’ll leave…
-
5
votes1
answer157
viewsA: Limit counter() to a certain level of the list list
To limit the propagation of the style you want to apply, you can make use of the selector > which limits the same to the direct child without propagating to "grandchildren" and…
-
3
votes1
answer1632
viewsQ: Warning: array_filter() expects at Most 2 Parameters, 3 Given
I have the following code that was taken from example #3 in the PHP documentation for the function array_filter(): $arr = array('a' => 1, 'b' => 2, 'c' => 3, 'd' => 4);…
-
4
votes4
answers180
viewsA: Remove array positions that have the common name
With your current code, for the stated purpose, you can do so: $arr = array( 'id' => '147', 'nome' =>'João', 'email' => '[email protected]', 'data_nascimento' => '05/01/1987', 'numero_1'…
-
5
votes5
answers611
viewsA: How to count items correctly?
If you have the string in the variable $episodios ending with a , this will generate an empty input in the matrix. A solution involves the use of the function array_filter() which allows you to…
-
1
votes1
answer70
viewsA: How to list checbox data?
How you want to save the "areas" in a single field of the database but they come in a array, have to gather all the entries from the array in a string and that’s where the function implode() of PHP…