Posts by Woss • 73,416 points
1,476 posts
-
10
votes2
answers810
viewsA: What is embedded programming?
Like the Magichat commented in his reply, the embedded programming is geared to codes that are executed on a specific platform, usually dealing with a specific problem and their practices/techniques…
terminologyanswered Woss 73,416 -
27
votes3
answers46967
viewsA: What is the difference between col-lg-* , col-Md-* and col-Sm-* in Bootstrap?
In the Bootstrap documentation itself there is a comparative table between the grid classes. That is, the class .col-xs-* define the grid for devices with a screen width less than 768px. The class…
-
7
votes2
answers1862
viewsA: Groupby in Javascript
I ended up developing a more generic function, presented below. function group_by (lista, coluna) { var colunas = {}; var resultado = []; lista.forEach(function (item) { var reg = {};…
-
6
votes2
answers1862
viewsA: Groupby in Javascript
I do not know if it is the best way, or the most efficient, but it generates the result you need. I believe that with the comments in the code it is possible to understand the logic. var lista = [ {…
-
1
votes1
answer75
viewsA: AJAX request for PHP page is not sent
1. There are two tags <head> in the code, delete a. 2. You are finalizing the instruction foreach PHP in the wrong place. You should finish it as soon as you complete the table row, indicated…
-
1
votes1
answer592
viewsA: Possibilities input Mask with jquery lib
I believe that you just set the mask as reverse by passing the object {reverse: true} in the second parameter. $(function () { $('#price').mask('00000,00', {reverse: true});…
-
1
votes2
answers300
viewsA: Typeerror: b is Undefined jquery.min.js:3:6371
Let’s take parts, first function loadPost: function loadPost() { var size = arrayPost.length; var imgPath = '/images/upload/poster/'; var post = arrayPost; ... } Here you recover the value of…
-
4
votes1
answer63
viewsA: How to browse a folder without knowing the name in PHP
Consider the following file structure: pasta/ d46as54d9as/ index.php With the function glob, just reading the basics of the documentation, we can do: foreach (glob("pasta/*/index.php") as $file) {…
-
4
votes2
answers3113
viewsA: How to check if the entity already exists in the bank
You can also check if the record already exists through the API itself DB of Laravel. if (DB::table('users')->where('id', 1)->count() == 0) { DB::table('users')->insert([ 'id'=>'1',…
-
1
votes1
answer124
viewsA: Working with identical forms on the same page
See the HTML code below. $(function () { $('input[type=button]').on('click', function() { formId = $(this).parent("form").attr("id"); $('#flash').html('Botão do ' + formId + ' pressionado.'); });…
-
5
votes1
answer55
viewsA: How to improve this method that compares three numbers?
I’ve never used Swift in my life, but I’ll risk an answer. @IBAction func comprar(_ sender: Any) { var maior = pNumero.text! messageLabel.text = "Primeiro número e maior" if sNumero.text! > maior…
-
0
votes1
answer326
viewsA: Python/Mysql- How to get the id of a table by comparing with two different
As described in the question, you already have the instruction that returns the id according to the value of username, as a subsequent: select id_paciente as id from pacientes where username =…
-
4
votes1
answer283
viewsA: How to get different outputs (fasta) files with Unix or python
File organization First, let’s define the organization of our files and the content in each one. fasta/ all.fasta id1.txt id2.txt fasta.py all fasta. is the main file, which contains the complete…
-
1
votes1
answer227
viewsA: Exchange the position of HTML Ivs
As the question cited as duplicate does not allow a solution with Javascript, I will put here a simple using jQuery. Considering the following HTML structure: <div id="menu">…
-
1
votes2
answers461
viewsA: How to recover the `mysqli->insert_id`from within this function, in addition to the query return?
Whereas you have the structure presented within a class: public function executar($sql) { $con = new conexao(); $con->abrir(); $re = $con->mysqli->query($sql); // Preciso retornar esta…
-
2
votes1
answer130
viewsA: Insert time period into database
First, let’s answer: Yes and no. Why? Yes, because there are ways to solve your problem, in order to store two dates, one referring to the beginning of a temporal event, another referring to its…
-
4
votes1
answer286
viewsA: How to print a string array on the screen?
As the message itself says: Array ( [0] => stdClass Object ( [meta_value] => value_1 ) ) Its variable $resultado is the type Array, containing a zero value of the type stdClass, which has an…
-
0
votes1
answer1973
viewsA: Use dropdown select in php mysql search autocomplete
Apparently the chat didn’t work very well here, so I’ll answer with what I think might solve your problem. The first thing we need to do is popular dropdown select with the existing categories in…
-
6
votes3
answers937
viewsA: How to insert into mysql using foreach?
Instead of you going through the list of tags of each record, being an array, you can make them a unique object, in JSON format, and store them only at once for each record. $leads =…
-
3
votes1
answer1342
viewsA: How do I take the auto increment ID using Mysql and PHP and use it later?
The PDO class, in PHP 5.1.0+, has a method called lastInsertID, according to official documentation. PDO::lastInsertId — Returns the ID of the last inserted Row or Sequence value So, after running…
-
2
votes1
answer1102
viewsA: How to pass a controller variable to view?
As defined in documentation of the framework, the load, to carry views and templates accepts a parameter of type array associative with values that will be present in the view/template. Since in the…
-
4
votes2
answers2763
viewsA: Problems to display my site on Chrome
Just transcribing the solution that was presented in the comments. The fact that you do not update the changes in the Chrome browser is the cache. If I’m not mistaken, locally, at least, Firefox…
-
5
votes2
answers1056
viewsA: Class return key and value of my attributes
A practical way is to add the method to_dict to class: def to_dict(self): return self.__dict__ To get the values as key/value, simply invoke the method: obj.to_dict(). See the official documentation…
-
9
votes2
answers1804
viewsA: Format String "28122016" for "2016-12-28" date
Solution If you are sure that the format to be treated will always be ddmmyyyy, you can create a function as follows: my_date = lambda d: "{}-{}-{}".format(d[4:8], d[2:4], d[0:2]) To use it, simply…
-
0
votes1
answer175
viewsA: Sending email using phpmailer
I believe your problem is the lack of the operator . to concatenate the values of the variables with the rest of the string. Note, for example, that in the code line…
-
2
votes1
answer583
viewsA: Cancel loop/script in progress on server
If this program has entered an infinite loop in an unwanted way, you can kill the responsible process through the command kill PID, where PID is the id of the referred process. To find out the PID,…