Posts by Vinícius Lara • 3,750 points
134 posts
-
3
votes1
answer49
viewsQ: How to expose a set of functions that is within an object in the global scope?
I’m building a Javascript API that returns a set of functions accessible through an object. Every time I want to access some of these functions, I need to enunciate the object, for example:…
-
-2
votes2
answers96
viewsQ: How to call a method not defined in the abstract class, but in the class that inherits it
Suppose there is a class and in its constructor it is necessary to call a function that is only defined in classes that inherit it. What is necessary for this to happen? Sample code: interface A {…
-
1
votes3
answers71
viewsQ: How to work with files and database in a way that is possible to consist
In a system where one works with file uploads being necessary to consist the links of these files in the database, which is the best approach to do it? Example: A registration system where it is…
-
2
votes1
answer88
viewsQ: Increase multidimensional array size at runtime
Problem: I maintain a 2D multidimensional array that has a dynamic size, is always growing, as I am not allowed to use vector I need to develop a strategy to increase the size of this array at…
-
0
votes1
answer74
viewsQ: Change class attributes passed as parameter to another class
There are two classes, classa and classb, where it is passed as a parameter to the classb an instance of classa and subsequently an attempt is made to change a parameter of the classa through the…
c++asked Vinícius Lara 3,750 -
1
votes1
answer113
viewsQ: How to change parameters of a class within a thread
I am initiating a class in the global scope, then I create a thread that alters a parameter of this class. After closing the thread I ask the class what parameter value I just changed, it tells me…
-
1
votes1
answer102
viewsQ: Capture data into space, regex
I am using this regular expression to capture data between asterisks: \*(.+)\* however it miscaptures when the text is filled with asterisks, for example in: oi pessoas *lindas* e pessoas *lindos*…
regexasked Vinícius Lara 3,750 -
2
votes1
answer75
viewsQ: Get single lines in the database, mysql
It is necessary to obtain lines that are not have duplicates in a table, I did some research and found the function DISTINCT but this does not solve the problem, because it somehow groups the data.…
mysqlasked Vinícius Lara 3,750 -
0
votes1
answer127
viewsQ: Problems with selector and jQuery
I’m trying to run a code but it doesn’t work, I don’t know if it’s because of a logic error in its execution, see, this code runs when the button OK is pressed:…
jqueryasked Vinícius Lara 3,750 -
0
votes2
answers864
viewsQ: How to upload image canvas
I get the result of an image through this function this.canvas.toDataURL('png'), this function generates the image normally, the dots are: How to upload this to the PHP server using jQuery? Is it…
-
0
votes2
answers8899
viewsQ: Cannot read Property '0' of Undefined, prototype incompatibility
I am using a script that sorts a JSON in alphabetical order with indicative header, as shown in this question however I am not able to make it work in harmony with prototype, returns me the error:…
-
3
votes1
answer213
viewsQ: How to change an attribute, javascript
I’m trying to change the value of an attribute but apparently nothing changes, see the example used: console.log(document.getElementById("stars").offsetTop); // me retorna 83…
javascriptasked Vinícius Lara 3,750 -
2
votes1
answer538
viewsA: How to do a ternary <checkbox> check with PHP?
Checkboxes that have not been checked will not be sent to the server, but depending on the context that this application works it is necessary to check the value of the checkbox, to avoid future…
-
10
votes1
answer10998
viewsQ: How websocket works in php
I have this doubt, for example, I have a server written in PHP. When a user A connects to this server the server performs an action that takes 4 seconds for example, if before that deadline a new…
-
1
votes1
answer175
viewsQ: Difference of using own module and libraries, Nodejs
I’m starting in nodejs, it’s all "new" and I’ve come across this conflict. There are the modules (I call modules, I don’t know if it’s right) ready etc.. however I have libraries like Cryptojs which…
-
0
votes1
answer105
viewsQ: Asynchronous jQuery-Prototype conflict
Well I hold the use of the two libraries and so that there was no conflict I chose to use the jQuery.noConflict() however at the same time I tried to keep the use of dollar but my code breaks due to…
-
31
votes2
answers957
viewsQ: How to test software well?
Well, I was thinking how sites with great access users do tests on their software and test them for final release, why anything or error of code can lead to gross system failure is interruption at a…
-
2
votes1
answer130
viewsQ: Would Bigpipe be applicable in this case?
I was reading about how big web-sites work and I got to know Bigpipe. What is Bigpipe (kids) Bigpipe was a feature created by facebook, what it does is make page loading time faster, page content is…
-
2
votes1
answer273
viewsQ: Save REQUESTS AJAX to be executed later
Use jQuery and the Ajax library to make REQUESTS. There is a way to save REQUESTS, follow the example.. The user is there moving and suddenly the connection drops and the user does not notice it.…
-
1
votes1
answer525
viewsQ: operators || or OR in PHP
What’s best and how to use? I’m trying to run this code for example and it doesn’t work if(1 !== 1 || 2) { echo true; } it displays the true being that it was to show only if X (in case 1) was…
phpasked Vinícius Lara 3,750 -
0
votes1
answer629
viewsA: Encrypt with MD5 the image name coming from PLUPLOAD
Understanding what you want If I understood your logic you would just like the name of the image on the random pseudo server to the point that it does not interfere with the storage and let alone a…
phpanswered Vinícius Lara 3,750 -
1
votes1
answer467
viewsQ: Overlay div on before, css
How to overlay the contents of the div on the before element of itself? I’m teening to make sure that the straight line doesn’t show up when I’m in the words, so it looks like this: ---------…
cssasked Vinícius Lara 3,750 -
3
votes3
answers1139
viewsQ: Organize alphabetically with indicative header, json
I have the following tree of names in Json: [{"nome":"Alberto"},{"nome":"Cristiana"},{"nome":"Altura"},{"nome":"Ivino"},{"nome":"Otário"},{"nome":"Umberto"}] How do I organize them in alphabetical…
-
0
votes2
answers194
viewsQ: Convert PHP TIME() to Datetime with Javascript
How to convert a time() generated with a PHP for a Datetime style: 2015-07-14 21:42:44
-
1
votes1
answer34
viewsQ: Search Interlaced ID (mutual), sql mysql
I have a table with this format RELATIONS ----------------- ID | ID_1 | ID_2 all in INT and the ID is self incrementable. She’s filled this way: ID | ID_1 | ID_2 ----------------- 1 | 1 | 5…
-
2
votes1
answer103
viewsQ: Organize contents and make "pagination"
I would like to assemble a system that automatically does the paging with only the jQuery/Javascript with the Rows I get. The Server can return me 1 Row as it can return me 1 million, and jQuery…
jqueryasked Vinícius Lara 3,750 -
2
votes3
answers229
viewsQ: Search HTML LIKE style %.. %
How can I search in HTMLS style LIKE %..% type I own these Divs with these styles <div class="texto_de_reportagem">Olá meu nome é fulana de tal e nasci assim vou morrer assim…
-
3
votes2
answers69
viewsQ: Give same value independent of the order
I needed to somehow generate a "hash" from a string but that the same hash is obtained independent of the order of the two strings 1234+4321 = asdfghjkl 4321+1234 = asdfghjkl this is possible with…
-
2
votes2
answers365
viewsQ: ORDER BY COM GROUP BY to get last Row, sql
I am using this SQL code to retrieve data, first it groups then organizes by birth date of Rows. SELECT U.id, U.born_data, U.bold FROM users U GROUP BY U.bold ORDER BY U.born_data DESC However he…
-
3
votes2
answers37
viewsQ: Set a global error for Ajax requests
I have several Ajax requests, and did not set an error option for any of them. Is there any way to set a global error for all requests? Similarly there is the sucess: {... but globally without me…
-
0
votes1
answer34
viewsQ: Remove total color from``
I put this code in my projects to eliminate the color when something is selected, however the times "blank spaces" that stay are colored with colors that should not, have to avoid or put transparent…
cssasked Vinícius Lara 3,750 -
4
votes1
answer68
viewsQ: What kind of "phocus" is that?
I was reading articles on this site, http://zenorocha.com/, and selected a content and the page closed in content and gave a special "Focus", I searched a little on the internet but found nothing…
-
4
votes1
answer3035
viewsQ: How to put one element before another with jQuery?
How to make a certain HTML before another div? I tried using prepend but it puts at first into the div but I want it to put up/before and outside of it, using prepend she gets like this: <div…
-
3
votes2
answers903
viewsQ: Search through ID and attribute
How to get a div for example through your ID and Attribute in specific like this: <div id="Y" data-id="X"></div> that is, a code that picks up a DIV with id=Y and data-id=X…
-
5
votes1
answer67
viewsQ: How to get the value of a property using variable as name?
How to make him search the property ABC instead of A? Taking this code into account: A = 'ABC'; alert(LANG.A);
-
0
votes1
answer55
viewsQ: Connection between 3 tables to rescue information, sql
I have 3 tables with this structure I tried but could only enter two tables, but I would need it to be in the 3 to "save/clean" code. it is necessary to enter the table helpcenter_topics catch a few…
-
3
votes2
answers1676
viewsQ: Catch last div of a div
Considering this structure: <div id="PAI"> <div uniqid="1" class="filho">A</div> <div uniqid="2" class="filho">A</div> <div uniqid="3" class="filho">A</div>…
javascriptasked Vinícius Lara 3,750 -
2
votes3
answers867
viewsQ: Reset the Alert function
We use alert(text) to give an Alert in the window, there is a way to reset this function to instead of displaying this default window it displays a custom made in HTML but without losing its real…
javascriptasked Vinícius Lara 3,750 -
11
votes1
answer455
viewsQ: Detect phase change, Navigator.online
I wear this navigator.onLine to check if the user is connected, however I need to constantly check and use setInterval for this, there is a more elegant way that leaves this gambiarra behind type a…
javascriptasked Vinícius Lara 3,750 -
2
votes2
answers1865
viewsQ: Update JSON value with Javascript
How can I update the value data.dM without having to rewrite everything..? when I do data.dM = 'lalalaa'; the value is not updated in data var data = [{ "dM": 'lolololo' }]; data.dM = 'lalalaa';…
-
5
votes1
answer830
viewsQ: KEK (Key Encryption Key) what it is and how to use it correctly
I was reading "Cryptography and Security: The official RSA guide" but I was limited to a few pages (if anyone has the PDF please share!!) and then I came across KEK and could not read more.. What it…
-
1
votes2
answers178
viewsQ: Picking up items with array prefixes
I own a array thus: array('one' => 1, 'two' => 2, 'three' => 3, 'my_one' => 55, 'my_two' => 33). But I’d like to take only the data that started with my_*. Is there some more elegant…
-
0
votes1
answer33
viewsQ: add dimensional items to the array
How can I add items to the array this way: array_push($arr, $end[0] => $end[1]); did not want to add a new array within the existing one, but rather to add new items in the $key style =>…
phpasked Vinícius Lara 3,750 -
2
votes1
answer184
viewsQ: Get $_SERVER user information via socket
Look, I’m wearing it new WebSocket to develop my applications and need somehow to have access to these variables of the connection I’m receiving through the sockets over PHP, is there way to it or…
-
3
votes1
answer2068
viewsQ: Check if more tabs of site X is open
There is the possibility to check if my site is open more than once in the user’s browser? My site requires that only one tab be used to avoid communication error, so I need to alert the user when…
javascriptasked Vinícius Lara 3,750 -
4
votes1
answer137
viewsQ: How to transcribe Javascript functions to PHP
How can I transcribe these functions to PHP? function bytesToWords(bytes) { var str; for(var i = 0; i < bytes.length; i += 2) { var char = bytes[i] << 8; if (bytes[i + 1]) char |= bytes[i +…
phpasked Vinícius Lara 3,750 -
0
votes1
answer60
viewsQ: Sum of strings in PHP and Javascript
I came across this problem and conflicted, when using '+' in Javascript it "joins" and in PHP it gives me a number (Hi?), well the intention is to adapt the Javascript with PHP, see:…
-
0
votes2
answers123
viewsQ: Convert array to string again
I use this function to transform words into bytes, function bytesFromWords (string) { var bytes = []; for(var i = 0; i < string.length; i++) { var char = string.charCodeAt(i); bytes.push(char…
javascriptasked Vinícius Lara 3,750 -
1
votes2
answers227
viewsQ: Use Promise in a Web Worker
TO using Web Workers for certain things, has how to use a Promise for when it finishes running? Kind of WR.postMessage({taskID: 'g_b_i'}).then(function(nonce){ console.log(dT(), 'Sending parameter…
-
3
votes2
answers405
viewsQ: How to use the Maximum Common Divisor (GCD) function in Bigint.js
I’m trying to use the function GCD library Bigint.js. But somehow, I try to use raw numbers, but it returns 0 In the description it says // bigInt GCD(x,y) // return greatest common divisor of…
javascriptasked Vinícius Lara 3,750