Laravel Best Practices
Principle of Single Responsibility
A class and a method should have only one responsibility.
For example:
public function getFullNameAttribute()
{
if (auth()->user() && auth()->user()->hasRole('client') && auth()->user()->isVerified()) {
return 'Mr. ' . $this->first_name . ' ' . $this->middle_nam ...
Added by jonemo on Fri, 23 Aug 2019 09:20:43 +0300
Development of Big Data Module--Statistical Analysis
After the data warehouse is built, users can write Hive SQL statements to access them and analyze the data.
In actual production, which statistical indicators are needed are usually proposed by the relevant departments of data demand, and new statistical requirements will continue to emerge. The following are some typical indicators in website ...
Added by davey10101 on Fri, 23 Aug 2019 06:58:37 +0300
Mina Implements the Complete Process of Socket Communication
title: Mina server-side client communicationdate: 2018-09-30 09:00:30tags:
- [mina]
- [tcp]
categories:
- [Programming]
permalink: zxh
[TOC]
The first two chapters have introduced the theory completely. Today we use these theories to implement the c/s communication of tcp protocol.First, let's briefly review the previous introduction.In mina, o ...
Added by kaos057 on Fri, 23 Aug 2019 05:30:04 +0300
What is ActiveMQ for your girlfriend?
1 ActiveMQ
ActiveMQ is a message middleware. There are many open source products of message middleware on the market, such as RocketMQ, RabbitMQ, Kafka and so on.
To take a simple analogy, message middleware is a transit station, adding a transit station in the program, with such a storage site similar to express delivery, can greatly reduce th ...
Added by andy_b42 on Tue, 20 Aug 2019 12:30:22 +0300
python reptile cookies at 8th pass
Project: Blog Comments
I registered an account in advance - account: spiderman, password: crawler 334566. Please copy the following blog login address and open it in the browser:
https://wordpress-edu-3autumn.localprod.oc.forchange.cn/wp-login.php ...
Added by rotto on Tue, 20 Aug 2019 09:19:54 +0300
Thread pool and Simulation Implementation
Thread pool
A thread usage pattern. Too many threads can lead to scheduling overhead, which will affect cache locality and overall performance. Thread pools maintain multiple threads, waiting for supervisors to assign concurrent tasks. This avoi ...
Added by 9902468 on Sat, 17 Aug 2019 11:12:26 +0300
MySQL 5.7 (or PXC 5.7) makes full use of cpu multi-core processing capability and general optimization of mysql/pxc
In earlier versions of MySQL 5.1, the innodb_file_io_threads parameter defaulted to 4, which was unchangeable on linux systems but adjustable on windows systems. The function of this parameter is that InnoDB uses background threads to process the ...
Added by Accurax on Wed, 14 Aug 2019 12:27:34 +0300
Introduction to Application of Reptiles
Articles Catalogue
I. Overview of the Basic Principles of Reptiles
1. Basic Reptilian Process
2. Request and Response
3. Request
4. Response
5. The data types captured
6. Analytical Approach
7. JavaScript rendering
8. Preservation of data
2. Reptilian login github
1. Send get request to Github log ...
Added by nigaki on Mon, 12 Aug 2019 09:15:27 +0300
okgo Learning Notes: Global Configuration
#okgo Learning Notes (1): Global Configuration
Role: Note use.Original Detailed Development Document Address: https://github.com/jeasonlzy/okhttp-OkGo/wiki/Init
Initialization method
Typically configured in Aplication or base class, it only needs to be called once
log switch can be configured
Global ...
Added by oshecho on Mon, 12 Aug 2019 04:59:16 +0300
Hibernate 5 Introduction
Hibernate 5 Introduction
Articles Catalogue
Hibernate 5 Introduction
Preface
Environmental description
Configuration process
1. Database creation
2. Project Construction
3. Configure hibernate.cfg.xml
4. Mapping Relations
4.1 xml Mapping
4.2 Annotation Mapping
5. Create SessionFactory
6. Unit t ...
Added by freedmania on Sat, 10 Aug 2019 17:22:30 +0300