Attention to infinite classification

Infinite level classification is mainly realized by recursive algorithm and special data table design My code 1 /** 2 * Get the menu information of the order 3 * Using recursive methods 4 */ 5 public function getHierarchicalMenus($pid , $condition=array() , $cid = 0){ 6 $data = array(); 7 if (!isset($c ...

Posted by gray_bale on Sat, 02 May 2020 22:01:29 -0700

[design pattern] Prototype Pattern

Prototype Pattern is used to create duplicate objects while ensuring performance. This type of design pattern is a creation pattern, which provides the best way to create objects. This pattern implements a prototype interface, which is used to create a clone of the current object. This mode is adopted when the cost of creating objects directl ...

Posted by davidx714 on Sat, 02 May 2020 20:00:11 -0700

Section 4 of Django 2.0 introduction

Continued Django 2.0 introductory tutorial section 3 This section describes how to vote in the foreground. Build a simple form submission page polls/templates/polls/detail.html <h1>{{ question.question_text }}</h1> {% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %} <form action=" ...

Posted by mitzleah on Sat, 02 May 2020 16:49:41 -0700

Mycat's database primary key self growth (local timestamp) - yellow Tong

In the local time mode, the policy ID automatically generated by ID= 64 bit binary (42 (MS) + 5 (machine ID) + 5 (business code) + 12 (repeated accumulation). The local time stamp mode is mycat's default, so when you configure it, you need to confirm whether the sequnceHandlerType configuration in your server.xml is 2. To realize the local ...

Posted by amitkrathi on Sat, 02 May 2020 13:08:23 -0700

java interface calls memcached

1. Before connecting to the memcache server, set up the memcache server in advance, remember the ip and port number of the created server, and use the ip and port number to connect using java code. 2. Start using java links 2.1 introduce the jar files memcached-2.0.1.jar and memcached-1.1.jar into the project 2.2 con ...

Posted by ineedhelp on Sat, 02 May 2020 12:42:36 -0700

oracle table space temporary table space information query

I have been dealing with oracle database for two days due to work reasons, and I have stepped on many holes. Now I want to write some thoughts and share them with you. There are some incorrect points. Please correct them! 1. Query tablespace information select * from dba_tablespaces 2. View the relationship between users and ...

Posted by pomme on Sat, 02 May 2020 12:06:55 -0700

Model layer - 9: Query set API

This section details the API of the query set, which is based on the following model, the same as the one in the previous section: from django.db import models class Blog(models.Model): name = models.CharField(max_length=100) tagline = models.TextField() def __str__(self): # __unicode__ on Python 2 return sel ...

Posted by Sneo on Sat, 02 May 2020 12:02:14 -0700

Implement a simple database connection pool

Explain See the article of the head of the official account, and refer to a simple database connection pool. text ConnPool connection pool class must implement javax.sql.DataSource interface package com.datasource.connpool; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import ...

Posted by buzzby on Sat, 02 May 2020 08:45:51 -0700

ArangoDB data import

ArangoDB ArangoDB is an open source and free multi model database, which can flexibly build data models by using documents, graphs and key value pairs. Written in c + +, compared with other databases or graph databases, the community of arangodb is relatively small, with few related materials, most of which are in offi ...

Posted by Kitty on Sat, 02 May 2020 08:23:35 -0700

Regular backup of linux mysql

The project needs to back up the database regularly. Here are your own operation notes 1. Check the disk space    # df -h Filesystem Size Used Avail Use% Mounted on /dev/vda1 40G 3.6G 34G 10% / tmpfs 16G 0 16G 0% /dev/shm This is my current situation of linux server. I don't know why it's like this (I'm ...

Posted by joozt on Sat, 02 May 2020 07:56:12 -0700