Posts by Vinícius Lara • 3,750 points
134 posts
-
6
votes4
answers941
viewsQ: Time Sync() PHP and Javascript
if I generate a time() on the PC purchased in Brazil it will result a team according to our time and such, if I repeat the process in China, USA or any other place with a local PC or time() will be…
-
2
votes1
answer55
viewsQ: perform function that is within a Javascript Extract
I’m trying to use functions that are inside an export, for example the BigInteger, in fact they are all: http://travistidwell.com/jsencrypt/bin/jsencrypt.js but need to use them in another file not…
javascriptasked Vinícius Lara 3,750 -
2
votes2
answers559
viewsQ: Sum of values in variable does not occur, tofixed
It was supposed to be adding up.. but it didn’t, I added the parsefloat Why was giving error that it was not a function.. var x = 0; x = parseFloat((x + 0.4)).toFixed(1); // 0.4 x = parseFloat((x +…
javascriptasked Vinícius Lara 3,750 -
2
votes3
answers1196
viewsQ: getJSON does not work
it does not return the success value, but in the error it says it was all right $.getJSON( "en-us.json", function( json ) { console.log( "SUCESS"); }).fail(function(m) { console.log(m); }); Imagery:…
jqueryasked Vinícius Lara 3,750 -
6
votes4
answers3093
viewsQ: Function to check if number is prime in Javascript
In PHP would use: for($i = 3; $i <= ceil(sqrt($num)); $i = $i + 2) { if($num % $i == 0) return false; } What function to check using JS?…
-
3
votes4
answers673
viewsQ: Large integers and cousins
Is there any function that generates prime and integer numbers in considerably large sizes? If not, how to do it using Javascript?
javascriptasked Vinícius Lara 3,750 -
4
votes2
answers1373
viewsQ: Shorten the string size
Is there any way to shorten the size of the type string zipar she and then deszipar as the Base64 function does?
phpasked Vinícius Lara 3,750 -
0
votes1
answer1011
viewsQ: ajax function does not work
I am using this small function to execute my ajax without mimimi, see var HTTP = 'http://127.0.0.1/'; function ajax(to, data) { $.ajax({ type: "POST", url: (HTTP + to), data: data, cache: false,…
-
1
votes1
answer590
viewsQ: Reconnect Websocket after connection loss
I use this code to connect to my server with Websockets: (function(nameSpace) { function createMethod(method, options, stateCallback) { var that = this; this[method] = function() { if (stateCallback…
-
1
votes1
answer1313
viewsQ: Uncaught Invalidstateerror: Failed to execute 'send' on 'Websocket'
Uncaught Invalidstateerror: Failed to execute 'send' on 'Websocket': Still in CONNECTING state. (index):29 (Anonymous Function) Code: function smConnect() { ws = new…
-
6
votes2
answers4323
viewsQ: Format number for only 2 digits
I have a script that returns: 4.499999999999 But I wanted it to return only 4.4 or round to 4.5, just do not want it to stay more than 1 digit after the comma, how to do?
-
5
votes2
answers781
viewsQ: Delete all console logs
there is some way to delete all logs from the console and start again, like I inserted several logs there using console.log, but I want to remove all of them at once and start again by inserting…
javascriptasked Vinícius Lara 3,750 -
3
votes2
answers292
viewsQ: Undo error display on console
Is there any way you want to display errors in the console? like Javascript errors or something?
javascriptasked Vinícius Lara 3,750 -
8
votes2
answers214
viewsQ: What happens if I don’t specify the { }?
I own this code that works normally: if($time <= time()) { if($time != 0) $Server->wsSend(1, 'perfect world'); foreach ( $Server->wsClients as $id => $client ) $time = time() +…
-
0
votes1
answer122
viewsQ: WEBSOCKET and PHP data storage
I came across a question, I have a Websockets server written in PHP and need to store information that the user sends to the server, and that this data can be recovered only by the current session…
-
-2
votes1
answer66
viewsQ: Generate large proportion prime and integer numbers
How would I generate 300-digit Primes for example in PHP? And integers of the same ratio? I need them for use in encryption with Diffie-Hellman.…
-
4
votes3
answers10588
viewsQ: Global variable in all functions of the class
Usually when I want to pull a variable that is out of class, I use global $variavel, but wanted this variable to be accessible in all functions of the class, not to be needing to "pull" in all…
-
10
votes1
answer248
viewsQ: How to check if the message has been delivered, websocket php
How can I check if a message that is sent by the WEBSOCKETS Server has been delivered to the end point? I use this class:…
-
1
votes1
answer1795
viewsQ: PDO mysql php accentuation problem
I am using this class to manipulate records in Mysql using PDO http://www.imavex.com/php-pdo-wrapper-class/ But I suggest ééé and inserts me éé at the bank the database is uft8 the script header…
-
2
votes2
answers3701
viewsQ: Get directory from server
How can I get the directory where the server is located using PHP? The directory of the server and not the file where the script
-
2
votes1
answer210
viewsQ: websockets and php
Well, I have two direct doubts, which are: is limited the number of connections to the server? what limit does it? is it possible to have infinite connections? How could I send a message to a…
-
2
votes1
answer35
viewsQ: Query not identifying value
SQL command: SELECT message, count(message) as amount FROM `messages` WHERE LENGTH(message) >= 4 AND amount < 30 AND message != '#ddd' AND message != 'ddd' GROUP BY message ORDER BY amount…
-
2
votes1
answer62
viewsQ: transform blob into text and do reverse function later
I am using a script that results audio/video in blob format, you need to upload it BUT I would like to turn it into text so that the execution of a function the part does not harm. And when it…
-
0
votes2
answers99
viewsQ: Keep only the last 3 backup files
I have a system that backs up information and saves it in a folder with this title: db-backup-20150308-034000.sql which is a variant title according to date and time, let’s see that I do not want to…
phpasked Vinícius Lara 3,750 -
3
votes3
answers527
viewsQ: Protect secret configuration file
I have an isolated file of the others called config.php. It holds information of 3 Databases and some secret passwords, but necessary for the functioning of the system as a whole. I wanted to…
-
4
votes2
answers308
viewsQ: Rewind image and return to function
I need to pass an image file to a certain function, this function usually receives the image from an upload like this: $filter = new ImageFilter; $score =…
phpasked Vinícius Lara 3,750 -
1
votes1
answer32
viewsQ: Install Memcache in xammp for mac
How can I install PHP Memcache on my mac? I use Xampp and need this feature..
phpasked Vinícius Lara 3,750 -
5
votes1
answer209
viewsQ: Get Rows that are not from the logged-in user
I have a table with columns para and de where I enter different Ids in each one, but I need to get the ID of the user who SENT the request to me, ie the ID that is not the same as the logged in…
-
2
votes1
answer742
viewsQ: CSS interfering with element position while dragging
I have a script that allows you to click and drag an element through the screen and take it to the footer of the page, which has an area that attracts the dragged element. At the top of the page is…
-
1
votes1
answer272
viewsQ: Search the database with encrypted data
I own a database where the entered data is encrypted through a function written in PHP, this function encrypts and decrypts. I need to search this table. For example, I search for "BRAZIL", but in…
-
0
votes2
answers115
viewsQ: Get div above the current
I have a set with several Ivs, <div>1</div> <div>2</div> <div>3</div> <div>4</div> I am giving each of them, and I need to know what is the number…
-
1
votes1
answer80
viewsQ: Adapt function to queryselectorall
I’m trying to adapt a function that used to be used only with Queryselector, but I need to adapt it to get all the Divs (Queryselectorall). Look at: var draggableEl =…
-
4
votes1
answer400
viewsQ: Line break interferes with regular expression capture
I’m needing to capture some Divs information that are sometimes separated by breaking lines, and this makes the operator (.*) capture not. For example, I have regular expression: <div…
-
2
votes3
answers133
viewsQ: Regex capturing it all
I’m in trouble with a Regex, she’s not just taking it 1 de 8 as I wish, she’s getting way beyond this, see : https://www.regex101.com/r/eX6bC9/1 That’s the string I’m trying to match: <span…
-
0
votes1
answer918
viewsQ: Scan all pages, Curl
I need to access a site through the Curl and capture content from his page, but it does not show all content on a single page, it divides them into several pages at the end it shows that menu to…
-
3
votes1
answer88
viewsQ: Get Rows from at least 3 days ago
I have a table with column datetime and I need to get the results that already have 3 days of existence, all more than 3 days, I tried to use SELECT *, DATE_FORMAT(date, '%m/%d/%Y') FROM tb WHERE…
-
6
votes3
answers229
viewsQ: Foreach returning unconverted array
I’m using this little code to capture words with minimum 2 characters, but it returns me: Notice: Array to string Conversion in echo $word; preg_match_all("/[a-z0-9\-]{2,}/i", "oi voce tem problema…
phpasked Vinícius Lara 3,750 -
4
votes1
answer37
viewsQ: Check if a variant div exists
I have several Ivs with the class prefix "webserver_[.. ]" and would like to check if any div with the prefix "webserver_[.. ]" exists, only with jQuery, how to do?
-
1
votes1
answer873
viewsQ: edge on TR not appearing
I’m applying edge to the TR’s <tables> but in no way it appears, see the code snippet: .rwd-table tr { border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; } See full code: .rwd-table {…
-
1
votes1
answer282
viewsQ: Give preference to greater equality, mysql
I have a table with a column called X in it I enter values separated by comma, for example: 1,2,3,4,5. Use this query to capture certain Row. SELECT * FROM 'x' WHERE CONCAT(',',x,',') LIKE '%,1,2,%'…
-
1
votes1
answer57
viewsQ: Organize incoming date and change, jquery
I get two Ivs from the server that way: <div id="1"></div> <div id="2"></div> However these documents already exist on the page, so I just wanted to update their proper…
-
4
votes3
answers739
viewsQ: Add space to each letter in UPPERCASE
How to make space using PHP when you start a capitalized word, for example, a string oiEusouMuitoLegal result in oi Eusou Muito Legal.
phpasked Vinícius Lara 3,750 -
1
votes2
answers1472
viewsQ: Only get words from A-z and numbers 0-9
How can I remove anything other than a letter and number string, that is to remove (!@#$%^&*():"><?} etc.) and keep only the letters of a-z and numbers of 0-9
-
4
votes4
answers249
viewsQ: Most common words among Rows
Is there any function in Mysql that gives me the 3 most common words between a column in format TEXT one-table? Example Maria Joaquina Maria Antonienta Maria B. among these Rows he returns Mary…
-
1
votes1
answer72
viewsQ: OR returns unexpected result
I’m performing that function SELECT COUNT(id) FROM `system_stats` WHERE `name` = 1 OR 0 AND `us_id` = 0 It returns me a value equal to 1, but this 1 no, when I run separately this way, it returns me…
-
4
votes2
answers201
viewsQ: How to save space in audit log?
I was creating a system that provides me data of my users according to the date I request, from X to Y for example. And the only way I could find for that was to create a table that way: date with…
-
2
votes1
answer393
viewsQ: Separate Rows by group and their percentage of total
I need to get the top 10 results that appear in my table and their respective percentages by groups. For example the table: +-----+-----+ |id |fruit| +-----+-----+ | 1 | or | | 2 | ban | | 3 | or |…
-
1
votes2
answers770
viewsQ: How to calculate average time?
I have a table named visitantes in it I insert the hora_que_entrou and the hora_que_saiu of my user on my website. These are in format DATETIME. I would like to run the average they passed onlines,…
-
3
votes4
answers632
viewsQ: How to execute two querys in a statement?
I need to mount a Mysql query that returns the total of rows, and the total of lines with value greater than 1 in the same query. Total of lines: SELECT COUNT(*) FROM tabela Total of lines with a…
-
2
votes1
answer97
viewsQ: Get data according to Mysql date
I need to provide the option to view the data according to an X time determined by the user, for example I want the data from 01/03/2011 until 25/12/2014 How can I do this with Mysql? How do I need…