Posts by Peter Krauss • 1,830 points
33 posts
-
0
votes1
answer49
viewsA: Turn a query into a HIVE file. CSV
As recalled for this Wiki reply, the command beeline allows to query and generate the result in CSV. You can "save a little something" for copy/glue or (strongly suggest) keep a standard command…
-
0
votes2
answers99
viewsA: Different behaviors between Ine and Ive-e
It seems that the main intention of those who ask is to have short commands, without bureaucracy. Responding to this type of intention: create an alias for each long and frequently used command.…
-
0
votes1
answer13099
viewsQ: 3-letter abbreviation table for cities by state
In the State of SP for example ADA would be Adamantine, ADO Adolfo, AGU Aguai, AGD High, ..., ADC, Alvaro de Carvalho, ABR Americo Brasiliense, ... SJC Sao Jose dos Campos, ... but "could be" is…
stringasked Peter Krauss 1,830 -
0
votes1
answer323
viewsA: schema.org: What to use: Microdata or JSON-LD?
I replied something similar in 2017, but I’ll try to refine a little here. Before some important reminders: Microdata is an extension of HTML to mark the content. Imagine, for practical effect, as…
jsonanswered Peter Krauss 1,830 -
1
votes7
answers11400
viewsA: How to validate phone in php
After having consulted this page and started to draft a gambiarra, I noticed that I had in the "trunk" a function ready... And looking above I notice that the foundation has already been given here…
-
2
votes12
answers5446
viewsA: How to remove accent in upload with php?
The simplest and most efficient way to remove accents is to map characters with an internal PHP function, the iconv: setlocale(LC_CTYPE, 'pt_BR'); // global (pode ser LC_ALL) function…
phpanswered Peter Krauss 1,830 -
3
votes7
answers2649
viewsA: Should people’s names be stored in two or just one column?
Short response: in 2 or more columns. Short justification: to meet standards. A little history helps to contextualize and understand the relevance of standards, and how they fit or not to each type…
-
1
votes3
answers2867
viewsA: Capitalizing on C#names
Conventions are more or less consensual, and can be expressed more universally as regular Expression. Step-by-step normalisation of a natural person’s proper name: ToTitleCase(nome), maíusculas…
-
1
votes2
answers10462
viewsA: Regular Expression for RG
MORE CORRECT It was almost good in the @Ronnyamarante reply, but as comments, forgot the "X"... As it is not always possible to deal with errors, here includes the parameter errChar just to remind…
javascriptanswered Peter Krauss 1,830 -
3
votes2
answers6702
viewsA: Is the ZIP code a unique ID in Brazil?
Arriving 1 year later, but the intention here is to record the link to the concept of "geographical thing designated by the EPC"... This leads to 2 answers. Only after having clarity of the object,…
-
2
votes9
answers10435
viewsA: My city zip code, where can I find open, updated and reliable source?
(This is not an answer, it’s a Wiki p. then join back on judson’s answer) PAD closed or the mailing list we’re checking. DRAFT v0.6 of 2015-05-21, closed review. Collaborative text for use by CGU To…
-
13
votes9
answers10435
viewsA: My city zip code, where can I find open, updated and reliable source?
(is not answer but VOTE negative or positive to express your opinion!) (is a WIKI: edit the will to better indicate the position) Possible legal alternatives What is being said, and perhaps the time…
-
40
votes9
answers10435
viewsQ: My city zip code, where can I find open, updated and reliable source?
The Postal Address Code, CEP (or ZIP code) the addresses of a city guarantee greater reliability to address data and to geolocation resolution by address... Remembering that address is not only…
-
3
votes4
answers5405
viewsA: Strategies to analyze very large databases in R (that do not fit in RAM)
I suggest as a solution to handle large volumes of data a database management system, "rice with beans" (relational model)... In that context, the best foss software (satisfies demands for…
-
3
votes2
answers6772
viewsA: How to do similar word searches in SQL?
Adding some nunces to the @gmsantos response... Metaphone for Portuguese names In this question has been widely discussed the phonetic algorithm for Portuguese, which is more efficient than the…
sqlanswered Peter Krauss 1,830 -
19
votes5
answers2310
viewsA: Why are other encodings used besides UTF-8?
(for a more cultural focus see this other question) Question-1. "(...) why there are still applications that adopt standards such as ANSI, among other encodings?" Answer. I would say "there are very…
-
2
votes0
answers184
viewsQ: How can the programmer/softhouse require customers and suppliers to respect the UTF-8?
(2020) See manifesto by UTF-8, and all the elements of discussion that still had around the subject by ~2015, at /a/28404/4186 From an international point of view and good practice, UTF-8 is the…
character-encodingasked Peter Krauss 1,830 -
3
votes1
answer174
viewsQ: Formal specifications, when to use? Do we have any actual standards?
When we specify "simple" algorithms (short stretches of a system) for other programmers to develop, we can give some tips on how to Implement, put or take details that can help or hinder…
software-engineeringasked Peter Krauss 1,830 -
22
votes4
answers6835
viewsA: Why should I only use a "Return" in each function?
Discussing a parallel issue... FEARS As the question refers to any language, any situation... I remembered situations where the problem was not style, elegance, readability, etc. but the logical…
-
5
votes2
answers1726
viewsA: Average a group of results
If you already have values in classes, jQuery already returns something that looks like an array, with all occurrences of that class... The classic method for dealing with this is the .each(), var…
-
1
votes2
answers1272
viewsA: What does it take for a system to support a locale?
The question is vague, in the sense of covering from installation problems in UBUNTU to the question of whether or not to deploy a system in Web... And have been marked only with the tags #location…
-
14
votes3
answers1491
viewsA: Strategies to prevent software regression
The term "software regression" comes from English "regression software", means "return of bug in the software" or "re-emergence of failure". In day-to-day we also use the term "side effect"…
-
10
votes2
answers4057
viewsA: Vocabulary of our language, where to find VOLP data?
(THAT’S NOT AN ANSWER!) The following notes are subsidies to the answers, and also a return to the comments posted on the question. It is a text Wiki: you can collaborate by reviewing and expanding!…
-
18
votes2
answers4057
viewsQ: Vocabulary of our language, where to find VOLP data?
The applications of complete and reliable dictionaries are immense (you don’t even have to choose them here!)... Our language, unlike English and many others without an "official reference", is…
-
47
votes5
answers41645
viewsA: What are the advantages and disadvantages between Mysql and Postgresql?
First a reminder: Mysql is no longer "100% public", its owner is Oracle, while Postgresql is 100% public and supports several other 100% public projects, such as Postgis. Mysql was well defended in…
-
28
votes6
answers17915
viewsA: How to make a phonetic algorithm for Brazilian Portuguese?
Names vs words of our vocabulary Given names are present not only in registers of natural persons, but also in place-names, street names, etc. It is a universe apart, immense, and the most common…
-
-1
votes2
answers1487
viewsA: Accent + $http.get
Yuri, if you’re publishing text in tongues, and you’re using header("Content-Type: text/html; charset=ISO-8859-1",true) something is already wrong (!). It is necessary for the programmer to commit…
-
0
votes6
answers3652
viewsA: How to detect page encoding with PHP?
Portuguese language programmers: our charset is UTF8! Briefly, this fact, for PHP programmers, entails two precautions: Pages, data, PHP scripts, everything must be encoded in UTF8. Be wary of the…
-
10
votes3
answers3756
viewsA: Problem using subst in text with PHP
This other question recalls that in PHP it is not enough to use the correct function, which, well suggested by @bfavaretto, is the mb_substr() in place of substr(): we also need to configure PHP…
-
12
votes8
answers56968
viewsA: PHP echo Special character problem ("ç")
No more ISO charset, use UTF-8! The Latin ISO was retired years ago, the W3C has been suggesting use of UTF8 (see RFC-3629) in all recommendations. Likewise, for Brazilian websites, the…
-
2
votes4
answers1914
viewsA: Check if a file exists on the remote machine via FTP in PHP
The best suggestion (and apparently the most voted) is ftp_size, since it neither opens the file nor loads the entire listing of your folder. I have not tested or compared restrictions, the fopen…
-
0
votes6
answers1877
viewsA: Code refactoring to convert GPS coordinates into DMS format into an array
If you are going to deal more intensively with geographic data, the suggestion is to use a framework or library with these things already embedded. There are very sophisticated standards and…
-
3
votes1
answer5437
viewsA: How to call a Postgresql 9.1 function?
You expressed two strings in the call. If you do SELECT '{"0","0","0"}', '{0,1,2,3,4,5,6,7,8,9,10,11,12,13}'; or SELECT '{"0","0","0"}'||'ola', '{0,1,2,3,4,5,6,7,8,9,10,11,12,13}'||'ola'; will…
postgresqlanswered Peter Krauss 1,830