Posts by zwitterion • 2,876 points
171 posts
-
1
votes0
answers753
viewsQ: How to use Eloquent without losing performance (51.39%) in Lumen 5.4?
Developing an API that should handle a high performance website. Doing some tests I verified that the use of Eloquent is downloading the performance of the requests in the database Mysql in 51.39%…
-
0
votes1
answer83
viewsQ: SQL SUM() syntax error
I have the following scenario: A table of products (tbl_prods) that has among other fields the price of each product the type of products and the date of the transaction (dt_trns). The guys can be…
-
1
votes3
answers4639
viewsA: How to reload the browser (Chrome) without cache, in addition to disable cache?
I found what was missing and I’ll share it because maybe it will be useful for vcs tbm. Right-click on the refresh symbol of the CHROME browser: You’ll notice that nothing happens. But if you open…
-
3
votes3
answers4639
viewsQ: How to reload the browser (Chrome) without cache, in addition to disable cache?
Selecting "disable cache" is sometimes not enough for the browser not to search for javascript in the cache. Or even knowledge. Some time ago I used a way that showed the option to empty the cache…
-
0
votes1
answer1783
viewsQ: "SQLSTATE[HY093]: Invalid Parameter number: no Parameters Were bound"
I have a simple class that runs an Insert on a Mysql database as follows: $db = new db(); $db->exec2([0=>["Brasil","BRA","BR"]]); In the db class I have the following list of queries :…
-
2
votes1
answer966
viewsQ: What are the steps to create a Docker image for Ubuntu 16:04, php 5.6 and apache (with Composer, Xdebug, phpunit, npm and REDIS)?
I’m a beginner in Docker and I’m trying to create an image with the following specifications: The source OS has to be the original Ubuntu 16.04. I cannot use images already available in the Docker…
-
1
votes0
answers256
viewsQ: How to access the root var/www/ directory of a Docker container via the host browser?
I’m starting on Docker. I created an image with the following command docker run -ti -p 80:80 my-image This image is a Ubuntu:14.04 where I installed apache and php5. I checked the root /var/www and…
dockerasked zwitterion 2,876 -
0
votes1
answer56
viewsQ: How to install only autoload and Laravel routes in a new project?
We are doing a test with a new project for a high traffic site (a few hundred, or thousands, of users per second) and wanted to know if there is any way to install only the route system and autoload…
-
0
votes1
answer318
viewsQ: How to update a table by going through another table in Mysql?
I have a scheme according to the picture below: The goal is to update the values of the seller_comission column in the table tbl_history. The table tbl_history already has a few thousand records.…
-
1
votes1
answer46
viewsQ: What is the advantage of having a single instance when using the Singleton standard in web development?
Researching a little more about Singleton I found some comments in favor and against the use of this approach. But I still doubt the usefulness of instantiating a single instance of a class (and…
-
9
votes2
answers1789
viewsQ: Where does the Git pull point?
I was reading the Git documentation about pull and I got confused: So let’s create a hypothetical sequence: I cloned the repository I made a git branch which shows only the master. The command git…
gitasked zwitterion 2,876 -
1
votes1
answer664
viewsQ: How to resolve XAMMP virtual host "Access Forbidden!" error in MAC OS Sierra 10.12.6?
I just installed a version of XAMPP xampp-osx-5.5.38-3-installer.dmg. Then I followed the instructions to set a virtual host. I activated Include etc/extra/httpd-vhosts.conf and created 127.0.0.1…
-
2
votes0
answers104
viewsQ: How to add Reliese/Laravel in the latest version of the Lumen/Laravel app?
I just installed the Lumen and I’m gonna need to use the Reliese to create Models (and Migrations) from an existing database. Following the documentation, after the installation I need to add…
-
1
votes1
answer636
viewsQ: Does anyone explain this git message after a pull to develop it?
I have the arm develop in my local machine. In develop remote there are about 10 programmers pushing every day. That’s why I always pull before merging my develop with the feature123 I’m working on…
gitasked zwitterion 2,876 -
0
votes1
answer28
viewsQ: How to send this "dt" variable to Promise.done?
I have the following javascript line: ... var refundVal = $( ".refundVal" ).val(); var dt={ orderId:orderId, refundVal:refundVal, process:btnProcess }; window.srObjc.confirm("message $"+refundVal+"…
-
1
votes1
answer1345
viewsQ: Where is Docker Store located on Ubuntu?
I’m studying Docker, so this question I’m asking is for a debutante. Images are the files that contain the configuration of the machine you want to create. Container is an instance of this image…
-
5
votes2
answers895
viewsQ: How to display in the browser and in a friendly way information from a JSON file?
The application receives a JSON file, already validated, and must display it to the user who is a programmer. I would like to display JSON as on this validation and beautify site JSON. So I wanted…
-
1
votes1
answer1045
viewsA: How to implement a map that shows real-time location - with displacement?
I found the solution for this application. A point (or any object - a marker) that moves in googlemaps using the API. An offset will be a sequence of points (positions) that will appear on the map…
-
1
votes1
answer375
viewsA: Googlemaps and Firebase in real time - Does not show points
I found the answer to the problem. It is the function initAuthentication(initFirebase.bind(undefined, heatmap)); I traded for initAuthentication(initFirebase(heatmap)); I just didn’t understand why…
-
1
votes1
answer375
viewsQ: Googlemaps and Firebase in real time - Does not show points
I’m following the tutorial which shows how to connect Firebase to Googlemaps in real time and shows the points of clicks on the map. I can enter the values (lat, long and time) in firebase but I…
-
1
votes1
answer1045
viewsQ: How to implement a map that shows real-time location - with displacement?
That is the scenario: For example, if I wanted to show all the homes of users of a city (those who are registered in the system) it would be enough to make a request in the database before the page…
-
0
votes2
answers65
viewsQ: How to recover everything after the "?" in Rewriterule?
I have the following rule that was created by another programmer and that is running in some processes: RewriteRule ^chk-error/(.*) chk_err.php?error=$1 [L] She recovers everything that comes after…
-
0
votes1
answer40
viewsQ: How to recover GET variables after it has been modified by . htaccess Rewriterule?
I have the following rule in . htaccess RewriteRule ^acesso-erro/(.*) proc_error.php?error=$1 [L] This rule retrieves the variables from the URL and puts in a "error". How can I recover this…
-
0
votes0
answers28
viewsQ: How to escape a recursive process of saving error log from a database - PHP?
I have a class that saves the log in a database based on any transaction error on that basis. The fact is that the process of saving this log tbm is a transaction and in a hypothetical scenario any…
-
0
votes0
answers35
viewsQ: How to use namespace when creating a class?
I’m working on a project that was created in php (5.3) without a framework. I need to use a database connection class I developed myself. The name of this class shall be db, but another class db…
-
2
votes1
answer356
viewsQ: How to identify if a request uses HTTPS?
I have to identify if the system sending us a request is HTTPS. if ($isHTTPS){ #faça alguma coisa } else{ #faça outracoisa }
-
2
votes1
answer1383
viewsQ: How to recover the body and header from a PHP POST transfer?
To recover the content body of a transaction we received via POST we use this function file_get_contents('php://input'). But there are several companies that can send a post request to our service…
-
1
votes2
answers73
viewsQ: Use unique identifier timestamp in a PHP process?
That is the scenario: A trading site that handles many transactions per second. Hosted on high-performance multi-core computers at AWS. The function is being used time() php to generate a unique…
-
7
votes2
answers1595
viewsQ: ORM (Eloquent) in Laravel 5.x VS Microservices architecture. How to develop web services using Eloquent that consume end-points of an API?
Consider the following architecture: This is a very modern model where the API offers end-points for different services to transact with the database. I am a begginer user in Laravel, so my question…
-
12
votes3
answers327
viewsQ: Query to get 1024 sum in maximum 3 transactions
I want to display people’s names (recipient) who received at least 1024 in a maximum of 3 transactions. Here the table "transfers": sender | recipient | date | amount…
mysqlasked zwitterion 2,876 -
2
votes1
answer997
viewsQ: Blade in Laravel 5.4 - How to work with class="active" in the menu links of a page in this scenario?
I have a menu with 3 possibilities: pg1, pg2 or pg3. The page is generated in Blade, using bootstrap. <a href="#" class="active">pg1</a> <a href="#">pg2</a> <a…
laravelasked zwitterion 2,876 -
3
votes0
answers394
viewsQ: Laravel in Linux with NGINX. Error 500 in browser and Permission denied in log. An analysis and how to solve in the best way possible?
I am installing an application in Laravel 5.4 in a Linux environment Ubuntu 16.04 with NGINX. I have seen that many people (just like me) always come across a 500 error in the browser, just after…
-
0
votes0
answers249
viewsQ: Are Getters and Setters automatically generated by Eloquent when we use reliese/Standard to generate Modules?
I have an application already functional. I am switching to Laravel 5.4. Since the database already exists and with actual data, my choice is not to use Migrations. One option would be to use the…
-
2
votes1
answer447
viewsQ: Returning HTML to an API would be good practice? Microservice?
This is the scenario: A company will offer information in the format of images and characters and htmls-iframes (coupons, clothing, products) so that its customers (stores, wholesalers, ruffians,…
-
1
votes1
answer472
viewsQ: How to access an NGINX server page from an AWS Ubuntu instance over the internet?
I just created an instance of Ubuntu in AWS and installed NGINX as a server. Everything seems to be right: root@ip-172-31-8-234:/home/ubuntu# netstat -ntlp Active Internet connections (only servers)…
awsasked zwitterion 2,876 -
1
votes1
answer571
viewsQ: How to execute a javascript code received by an AJAX request?
I have that code in the database: <script type="text/javascript"> alert("teste script-1"); var axel = Math.random() + ""; var a = axel * 10000000000000; document.write('<iframe…
-
0
votes0
answers105
viewsQ: Git - How to pull a selective pull for production?
I have the following scenario: 3 programmers (P1,P2,P3) with their local production environments, a QA test server and a production server. According to the company’s business rules there are…
gitasked zwitterion 2,876 -
1
votes0
answers94
viewsQ: Automating Ubuntu development environment startup - LEMP Stack + Laravel. How to schedule a break between blocks?
I am creating code to automate the startup of an Ubuntu development environment (LEMP STACK). Here I put Nginx Server + Mariadb + PHP7.0 + Laravel, ... , etc. The complete list with comments is…
ubuntuasked zwitterion 2,876 -
0
votes1
answer81
viewsQ: What is the indication of using Redis with Iots?
I have in my hands a project of integrating devices from a company to a web platform. This video shows a general idea of the project. These are various machines, which send information (status,…
redisasked zwitterion 2,876 -
0
votes2
answers1057
viewsA: Improve code to only get value from localstorage
See here a summary of how to "capture" javascript data and send it to php and how to recover this data in php Recupere os dados em PHP oriundos do Javascript $arrayPost = $_POST; //Se foi…
-
11
votes1
answer3066
viewsQ: Is Ionic development for Ios in a windows or linux environment possible?
I was wondering if there is any way to create iOS applications when our operating system is windows or linux. According to this Cordova, we would have to have an iOS operating system. Is there any…
-
1
votes1
answer28
viewsQ: How to pass a parameter in a GET verb when using Xdebug - Netbeans
I have a page mySite.com/api/v1/listUsers.json.php that will return a list of users to be consumed in an app. But I would like to take advantage of that same page and create the following condition…
-
0
votes0
answers785
viewsQ: Rest API in PHP - how to work with routes terminated in . json?
I am creating a Restful web service in PHP. I am not using any framework. I am following the recommendations of standards or best practices for developing web Apis, suggested by the White House. On…
-
3
votes3
answers4206
viewsA: How to update a web page automatically right after an entry into the database? Use Nodejs?
I had to spend a few days studying to find the right answer. Being able to use one technique or another does not mean that it should be used. It depends on the situation. In my specific case I could…
node.jsanswered zwitterion 2,876 -
1
votes0
answers29
viewsQ: Do SSE queries overload the browser?
I am working on a real time web project, which seeks information from the server through SSE. That is, the first request is made to the server, after that the server will send a JSON every second or…
-
0
votes3
answers4206
viewsQ: How to update a web page automatically right after an entry into the database? Use Nodejs?
This is the scenario: I have a central user, the manager of a hotel who will be monitoring 24 hours the status of the rooms in real time. The rooms have 3 status: 1-In use. 2-In maintenance…
node.jsasked zwitterion 2,876 -
0
votes1
answer148
viewsQ: Warning when installing nodemon. How to resolve?
I installed the nodemon with the following command $ sudo npm install -g nodemon I got the following mistake: npm WARN notsup Not compatible with your operating system or architecture:…
-
1
votes2
answers1970
viewsA: PHP error with Sqlserver Exception 'Pdoexception' with message 'SQLSTATE[08001]: [Microsoft][ODBC Driver 11 for SQL Server]
I work with mysql doing updates of an Mssql database. And I’ve used connections with ACCESS tbm. For the two use odbc connection. $db = odbc_connect( $connect_string,$user, $password ); As suggested…
-
7
votes4
answers1794
viewsQ: Node replaces Nginx? Can someone explain this architecture to me?
I was reading a article about the "dawn" of Javascript companies. The "dawn" in the sense that things are just beginning. That is, according to the author, the future is Javascript, with Nodejs, and…
-
1
votes1
answer80
viewsQ: How to create a robot to test traffic on my site on localhost?
I have a mysite.com site that is running in a local LEMP environment (Linux, Nginx, Mariadb, PHP7). The site is already ready and I have a database well loaded with many fake data. Before sending to…
robotsasked zwitterion 2,876