Posts by nunks • 2,268 points
65 posts
-
2
votes3
answers263
viewsA: Do not display Warning de foreach
In addition to all problems associated with the use of @already cited in the reply of @Guilhermenascimento, PHP documentation is clear where the error control operator can be used @: Note: The @…
-
1
votes1
answer91
viewsA: Diff changing lines
The problem is caused because equal records do not appear on the same line in both files. The diff compares files line by line. In the problem example you showed, line 2 of the file on the left is…
-
1
votes1
answer174
viewsA: Problem running a shell script using Zenity. Message: Gtk-Message: Gtkdialog Mapped without a Transient Parent. This is discouraged
Warning messages in GTK are something frequent and often, as in this case, can be ignored without there being any problem. In this particular case, to translate into intelligible language, the…
-
2
votes3
answers102
views -
1
votes1
answer186
viewsA: Error while trying to perform postgresql database backup
Since version 9.0, each large Object no Postgresql has its OID, as well as tables, indexes etc., and should not be treated as a simple record of the table pg_largeobject and therefore not…
-
1
votes2
answers47
viewsA: Insert filesystem image name in mysql
One way would be to use a script bash assembling the commands of INSERT and passes as input for the customer mysql, as an example: ls ~/folder_img \ | xargs -I{} echo "INSERT INTO imagens (arquivo)…
-
0
votes4
answers11127
viewsA: How to hide the Scrollbar, but without deactivating it
With pure CSS, you can literally hide the scrollbar of an element by placing it within another element of smaller dimensions. Without overheads... In the example below, the <div> #fixed…
-
4
votes3
answers1926
viewsA: How to put a php variable in a mysql query?
Thiagosilr’s answer is correct, just put the variable names inside the string with double quotes. However, I suggest not using this method to form darlings to be executed at your bank, as it makes…
-
0
votes1
answer32
viewsA: Select from two columns showing also what is not related
Utilize LEFT JOIN, so all the main table records tb_doenca will be returned, along with those matching them in the auxiliary table tb_vacina through the test nome_doenca = comb_vacina: select…
-
3
votes1
answer1298
viewsA: FULL OUTER JOIN generates errors
As demonstrated in that OS reply in English, Mysql does not support command FULL OUTER JOIN. As explained in the above-mentioned answer, you can emulate a FULL OUTER JOIN using the UNION ALL of a…
-
1
votes3
answers56
viewsA: Mass collection of information from files
Summarizing my answer, the full command would be: sudo debugfs -R 'stat <1055890>' /dev/sda1 | awk -F'--' '{gsub(/0x[a-z0-9:]+/, ""); print $2, $3, $4, $5}' | sed -r 's/^ //;s/ +/, /g' Full…
-
2
votes1
answer48
viewsA: Zipping folder except a subdirectory
The zip owns the flag -x or --exclude, which allows you to define file name masks and directories to be ignored during operation. So to ignore the entire subdirectory subdir-fora-do-zip compression…
-
0
votes1
answer227
viewsA: Use additional hard disk space Linux Ubuntu in main drive where apache is located
Create a symbolic link within the apache directory that points to your backup directory. After accessing your server via ssh, do: ln -s /caminho_da_unidade_adicional/backupGFS…
-
2
votes1
answer166
viewsA: Git flow - batch commands
You can create a alias git containing a function bash to do what you need by inserting it into the [alias] of your file .gitconfig: [alias] pub = "!f() { git flow hotfix finish \"$1\" && git…
-
1
votes1
answer2740
viewsA: Maximum SQL date
Aggregating functions as MAX() are applied in the context of GROUP BY, and as you are grouping across all fields, MAX() will return the highest limit date of each record. Experiment with a…
-
1
votes2
answers1364
viewsA: take all keys in a json array with js
Using the method keys class Object you get a array containing all the keys to array past. Then just make your loop on that list: //declaro o array "x" e insiro alguns valores var meuArray = [];…
-
2
votes1
answer747
viewsA: Problems with encoding in Database Query
The error message pasted in the question comes from Postgresql, and indicates that the database in question is not in the encoding UTF-8. To documentation indicates that it is not possible to fully…
-
0
votes1
answer359
viewsA: node extraction via postgresql
Short answer: yes. If you use data types that support arrays, in Postgres you can extract any elements from them, whatever their positions. Now let’s go to the long answer... Postgresql without…
-
2
votes1
answer250
viewsA: How to convert this character to Postgresql?
According to the documentation, Postgresql supports automatic conversion from UTF-8 to LATIN1, simply inform Character set of your client, in the case of the Delphi application. For this you have…
-
0
votes1
answer117
viewsA: How to replicate a particular bank in postgres to a particular door?
Set the data to connect to the server master in the recovery.conf server slave. This is where you tell your replica which door it will connect to: standby_mode = 'on' primary_conninfo =…
-
1
votes1
answer254
viewsA: Centos 7 - Proxy authentication without saving password
Consider simply setting permissions for yum.conf as 0600 and always execute the yum as root. So only those who know the root password can read the proxy password in the configuration. That being…
-
1
votes1
answer808
viewsA: display jpg image saved to postgresql database (oid) for html
Use the encoded file as string in Base64, and you can include it directly in HTML as follows (example with a very small PNG, to fit the answer): <img…
-
0
votes2
answers73
viewsA: Result of an online MYSQL search, not column
You can work the result of your query as a string, in order to enable its manipulation without having to presume its existence in a "hard-coded". Use the aggregation function GROUP_CONCAT to "merge"…
-
2
votes2
answers674
viewsA: Treat Curl return on Linux
A way to solve this kind of thing with bash is to use regular expressions to "clean" the return string and add separators that can then be treated with a cutting tool. Using the functionality of…
-
5
votes2
answers1701
viewsA: Left Join with + equivalent in POSTGRES
Postgresql does not have (+) as an OUTER JOIN operator, which is something outside the ANSI SQL standard. Oracle implemented support for the ANSI standard of OUTER Joins in version 9i, and even…
-
0
votes2
answers1455
viewsA: Database/slow server
It’s a fairly general question. Ideal is that you constantly monitor performance statistics of your databases and the infrastructure that supports them, so you can measure the impact of performance…
-
1
votes1
answer760
viewsA: update column in table - postgresql
Its TRIGGER is executed at each UPDATE and itself also executes an UPDATE, generating an infinite loop. Hence the HINT warning you that you are breaking the memory limit reserved for stack…
postgresqlanswered nunks 2,268 -
0
votes3
answers250
viewsA: How to select only the largest drive in Sql?
Make a subquery that returns all desired stock Ids using max(), grouping by what they have in common, which from what I understood from your question is the id_produto. You can even already filter…
-
2
votes3
answers3856
viewsA: Return month name as select
Postgresql has built-in methods for translating time strings, so that custom methods are unnecessary. You can use the function to_char, passing as first parameter the date extracted and, as second…
postgresqlanswered nunks 2,268 -
3
votes1
answer523
viewsA: Replication of a database
Each replication method has its pros and cons. As stated in the question comments, you need to identify your needs to then find the most suitable replication scheme for your application. Below, in…
-
2
votes2
answers384
views -
2
votes2
answers66
viewsA: Is indexing sites by half possible?
Taking the Googlebot as an example... According to this article on kissmetrics, Google’s Crawler indexes the entire page, including title, description, attribute alt of images and all the content.…
-
2
votes2
answers454
viewsA: Jenkins slave build with JDK not previously installed
I decided to register here a reply, from of this Q&A and of documentation from the Testcomplete tool, specifying settings needed to run on Jenkins Windows installations. What got me to that…
-
1
votes1
answer178
viewsA: Nth-Child selection in a table with even columns
The nth-child() supports the definition of cyclic patterns using notation an+x, where a is the cycle size and x is the index of the position of the element to be selected within the cycle. In the…
-
1
votes3
answers4171
viewsA: How to put columns of a table all the same size?
Set a minimum width for all <td> of your table, which is at least the size of the longest column header: .minhatabela td { min-width: 150px; } /* pura cosmetica */ .minhatabela { height: 100%;…
-
5
votes1
answer154
viewsA: bash - How to prevent malicious code execution via input?
The data entry proposed in the question causes code execution before passing the variable to the script. The use of subshell $() executes the command immediately and replaces its result in the…
-
2
votes2
answers1090
viewsA: Share cloud database (Postgresql)?
A file storage and sharing service like Google Drive and Dropbox is not enough, as Postgresql itself is a server. It needs to be running on a machine that accepts customers' access at port 5432 (by…
-
2
votes1
answer526
viewsA: How to delete files from my remote and local HEAD from my git but not delete from my disk?
Using git rm --cached Because you don’t care that the file continues in previous commits everything gets easier: First, include in your . gitignore the name of the files you intends to delete, as…
-
2
votes2
answers239
viewsA: How to transform data from a textarea into an ordered array?
One way to get this result is by chaining loops: $saida = array(); $tmp = explode(PHP_EOL, $_POST['textarea']); foreach ($tmp as $i) { $i = explode(' ', $i); for ($j = 0; $j < count($i); $j++) {…
-
2
votes1
answer1442
viewsA: How to do sub-query correctly in Oracle?
It is always good to think twice before using a subquery to solve an SQL problem, especially if it is something that handles large volumes of data or that is executed many times, because these…
-
3
votes2
answers104
viewsA: Time for shutdown, or immediate shutdown?
Cast below Asynchronous exclusion advantages. Summary: The user has an advantage in the "time of repentance" when deciding to keep his data and in matters of security violation (another person may…
-
0
votes1
answer119
viewsA: Push failure - Android Studio 3.0
It’s possible that he mistakenly set up proxy usage by git and he can’t resolve github.com. Try disabling git proxy settings by running on the command line: git config --global --unset http.proxy…
-
0
votes2
answers1117
viewsA: Change oracle characterset 11g
You’re falling into a problem of NLS_LENGTH_SEMANTICS. The field is, I imagine, a VARCHAR2 length defined by number of bytes (Oracle default) and not by number of characters. For Oracle, a column…
-
1
votes1
answer3365
viewsA: Write linux bash exits to a file
All you manually execute in the shell is "shell script code". Therefore, create a script file containing the execution of your tests and run it by redirecting its output to the desired file: Filing…
-
1
votes1
answer177
viewsA: select part of the JSON that was filtered in Where
Using a combination of JSON_SEARCH(), JSON_EXTRACT(), JSON_UNQUOTE() and the string manipulation function REPLACE(), I think I got to the desired result. Assuming the JSON structure is known,…
-
6
votes5
answers2539
viewsA: Regex to check if string does not end with certain characters
Use the rating of "Negative lookbehind" to ensure that the string does not end in the patterns you defined just before the line break, i.e., $ that does not have JJ or M3 before it. Thus, its…
-
0
votes2
answers410
viewsA: 1215 SQL code "Cannot add Foreign key Constraint"
Pointing out things that draw attention to your code: The foreign reference in FK codalundisc could be a typo: codisc or codigodisc? Foreign fields must be PK of their respective tables, as well as…
-
10
votes2
answers166
viewsA: What is the impact of changing the keypress event so that it interacts a 'level up' than the key would do natively?
As a rule, avoid changing the operation of the browser to avoid later incurring accessibility problems. If the audience of your site is restricted and is particularly informed about the shortcuts,…
-
1
votes3
answers4130
viewsA: Get X and Y from the screen using PYTHON
A quick solution using Pyuserinput and without going into specifics of operating system: instances of mouse have the method position(), which returns the position (X, Y) at each call: $ pip install…
-
3
votes1
answer91
viewsA: Procedure SQL (run every second)
To function RAND() returns a float from 0 to 1. (example: 0.47806898642151524. Multiplied by 15: 7.171034796322728) To function TRUNCATE() cuts a float by a number of houses decimals passed in the…