• Review Manual (1): data types


    A series of articles: Review Manual (1): data types Review Manual (2): variables and constants Review Manual (3): operators Review Manual (4): process control Boolean type Range: true; false; transformation:If it is false, it is true in all other cases var_ dump(boolval(0)); // bool(false) integer Range: //64 bit signed integer range, out of range converted […]

  • It’s time to upgrade your parquet: IOException: totalvaluecount = = 0


    Abstract:When using spark SQL to perform ETL task, an error is reported when reading a table: “IOException: totalvaluecount = = 0”, but there is no exception when writing the table. This article is shared from Huawei cloud community《It’s time to upgrade your parquet: IOException: totalvaluecount = = 0》Author: wzhfy. 1. Problem description When using spark […]

  • Django uses or conditional queries and various query keywords


    Django uses or condition query: from django.db.models import Q User.objects.filter(Q(state=0) | Q(state=1)) Django query keywords: __ Exact equals like ‘AAA’__ Iexact is exactly the same as ignore case like ‘AAA’__ Contains contains like% AAA%__ Icontains contains ignore case like ‘% AAA%’, but for SQLite, the effect of contains is equivalent to icontains.__ GT greater than__ […]

  • Detailed explanation of “pit” in go language for range


    preface The combination of for range in go can easily traverse an array or slice, but in some cases, it is likely to be “pit” when using for range func main() { arr1 := []int{1, 2, 3} arr2 := make([]*int, len(arr1)) for i, v := range arr1 { arr2[i] = &v } for _, v […]

  • Configuration encapsulation of API interface request


    Throw a question Question 1: in our daily development, we all encounter interface class requests, various third-party interfaces, and internal interfaces. How can we maintain these interface quick requests conveniently and quickly? Question 2: in the face of a third-party interface, remember when docking, do you think you can’t find it in the subsequent search? […]

  • Mongoose (mongoose)


    [email protected] quick get start const mongoose = require(‘mongoose’); /*Connect to database*/ mongoose.connect (‘ mongodb://localhost/mytest ‘{usenewurlparser: true}); // if there is no mytest database, it will be created by itself let db = mongoose.connection; //If a connection error occurs db.on (‘error’, ()=>{ console.error (‘connection error ‘)}; //If the connection is successful db.once (‘open’, ()=>{ console.log (‘connected […]

  • Important concepts and best practices of maven


    What is Maven Maven is a cross platform project management tool, which mainly serves for project construction, dependency management and project information management based on Java platform. What is construction In addition to writing source code, we spend a considerable part of our time every day compiling, running unit tests, generating documents, packaging and deploymentstructure(build)。 […]

  • What’s your understanding of media inquiry? What’s your understanding of media queries ?


    What’s your understanding of media inquiry? Brief concept Media query consists of an optional media type andZeroorMultipleThe composition of an expression that limits the scope of a style sheet using media features, such as width, height, and color. Media query, add fromCSS3It allows content rendering to be tailored to a specific range of output devices […]

  • Basic data types and basic application scenarios of redis


    Basic application scenarios of redis Get the winning user ID. after it pops up randomly, the set does not exist Store the winning user ID in the activity to ensure that the same user won’t win twice [set] Store the fan list, value is the user ID of the fan, score is the follow time […]

  • Understanding of BTREE index and hash index


    statement1) This article collates the selfless contributions of Daniel and experts from the Internet. Please refer to the references for the specific references.2) This article is for academic exchange only, non-commercial. If a certain part violates everyone’s interests, please contact Haihan to delete it.3) The blogger is short of talent and learning. If there are […]

  • Introduction to pandas (6)


    import pandas as pd gl=pd.read_csv(‘./pandas/data/game_logs.csv’) #Memory usage of data gl.info(memory_usage=’deep’) <class ‘pandas.core.frame.DataFrame’> RangeIndex: 171907 entries, 0 to 171906 Columns: 161 entries, date to acquisition_info dtypes: float64(77), int64(6), object(78) memory usage: 859.4 MB for dtype in [‘float64′,’object’,’int64′]: selected_dtype=gl.select_dtypes(include=[dtype]) memory_usage_b=selected_dtype.memory_usage(deep=True).mean() memory_usage_mb=memory_usage_b/1024/1024 print(‘[%s] memory usage %0.2f MB’ % (dtype,memory_usage_mb)) [float64] memory usage 1.29 MB [object] memory usage 9.50 […]

  • Gaode map API: Administrative Region + range + translation + latitude and longitude + mouse style


    Get the administrative region getcity() of the current map map <span style=”background-color: #f5f5f5; color: #800000;”> *</span><span style=”background-color: #f5f5f5; color: #000000;”>{</span><span style=”background-color: #f5f5f5; color: #ff0000;”>margin</span><span style=”background-color: #f5f5f5; color: #000000;”>:</span><span style=”background-color: #f5f5f5; color: #0000ff;”>0</span><span style=”background-color: #f5f5f5; color: #000000;”>;</span><span style=”background-color: #f5f5f5; color: #ff0000;”>padding</span><span style=”background-color: #f5f5f5; color: #000000;”>:</span><span style=”background-color: #f5f5f5; color: #0000ff;”>0</span><span style=”background-color: #f5f5f5; color: #000000;”>;</span><span style=”background-color: #f5f5f5; color: […]