How to set up a cron job in Django using django-crontab

Why do we use scheduled tasks For the static homepage, considering that the data of the page may be maintained by multiple operating personnel and changes frequently, it is made into a scheduled task, that is, the static is performed regularly Performing scheduled tasks in Django can be achieved through the django-crontab extension. Installation Configure installed applications Add… Read More »

Configuring HugePages on Linux

In virtual paging storage, the virtual storage space and physical main storage space are divided into pages of fixed size, and the memory allocation for threads is also in units of pages. For example, if the page size is 4K, 4GB/4KB=1M records are needed for 4GB storage space, that is, there are more than 1 million 4KB pages.… Read More »

音频文件格式与转换 Introduction on Audo File Format and Audio Converter

音频格式简介 音频文件格式专指存放音频数据的文件的格式。存在多种不同的格式。 一般获取音频数据的方法是:采用固定的时间间隔,对音频电压采样(量化),并将结果以某种分辨率(例如:CDDA每个采样为16比特或2字节)存储。采样的时间间隔可以有不同的标准,如CDDA采用每秒44100次;DVD采用每秒48000或96000次。因此,采样率,分辨率和声道数目(例如立体声为2声道)是音频文件格式的关键参数。 需要分清楚的是音频文件和编解码器不同。尽管一种音频文件格式可以支持多种编码,例如AVI文件格式,但多数的音频文件仅支持一种音频编码。 有两类主要的音频文件格式: 无损格式,例如WAV,FLAC,APE,ALAC,WavPack(WV) 有损格式,例如MP3,AAC,Ogg Vorbis,Opus 有损文件格式是基于声学心理学的模型,除去人类很难或根本听不到的声音,例如:一个音量很高的声音后面紧跟着一个音量很低的声音。MP3就属于这一类文件。 无损的音频格式(例如FLAC)压缩比大约是2:1,解压时不会产生数据/质量上的损失,解压产生的数据与未压缩的数据完全相同。如需要保证音乐的原始质量,应当选择无损音频编解码器。例如,用免费的FLAC无损音频编解码器你可以在一张DVD-R碟上存储相当于20张CD的音乐。 有损压缩应用很多,但在专业领域使用不多。有损压缩具有很大的压缩比,提供相对不错的声音质量。 值得注意的是,根据各流行音乐出版商及内容提供商的数据,FLAC是目前应用最广泛的无损音乐格式。FLAC(全称为 Free Lossless Audio Codec),中文直译为自由无损音频压缩编码(注:这里的“Free”指的是自由软件,而并不仅是免费)。FLAC是一款的自由音频压缩编码,其特点是可以对音频文件无损压缩。不同于其他有损压缩编码(如MP3 、AAC等),压缩后不会有任何音质损失,现在已被很多软件及硬件音频产品所支持。 音频格式转换教程 音频格式转换通常需要使用音频格式转换工具。一个合格的音频格式转换工具需要满足以下几点特性: 能够将多种常用的音频文件格式转换为指定的音频文件格式。源音频文件包括:MP3、WMA、FLAC等;目标音频文件包括:MP3、WMA、VOX、WAV、FLAC等。 能对转换为指定的音频文件格式的参数进行任意设置,参数包括 频率(Frequency)kHz 采样位(Sample)Bits 声道(Channel):单声道(Mono),立体声(Stereo); 支持批量转换,操作简单; 开源免费 本文推荐以下几个开源免费的音频格式转换软件(可直接在Release中下载): https://github.com/MattMcManis/Axiom https://github.com/adrielcafe/AndroidAudioConverter https://github.com/michaeltyson/TPAACAudioConverter https://github.com/audiamus/AaxAudioConverter   Introduction to Audio Format Audio file format refers to the format of the file storing audio data. There are many different formats. The general method to… Read More »

TOP 10 JVM Garbage Collection Interview Questions

Questions: Describe the Java garbage collection mechanism. What is GC? Why do we use GC? Advantages and principles of garbage collection, and describe two recovery mechanisms. What is the basic principle of the garbage collector? Can the garbage collector reclaim memory immediately? What’s the way to actively notify the virtual machine for garbage collection? What are the reference… Read More »

Heartbeat animation using HTML and CSS

We can create a simple heartbeat animation using HTML and CSS without much coding. The only thing we need to do is to add a box and use CSS to display it. First, add a visual box to the page Then, make a heart-shape box Finally, set up the animation. It’s worth noticing that the animation must be… Read More »

Step by step implementation of the AdaBoost model

When we make a decision every day, we often consult several people and comprehensively adopt their opinions. So is it possible to copy this idea into the field of machine learning and create multiple models to synthesize the results? Synthesizing is, of course, viable, and this idea is called the ensemble method. Ensemble method The ensemble method itself… Read More »

Best practices of using the Thunk in JavaScript

The evaluation strategy of a compiler is usually divided into pass-by-call and pass-by-call. Thunk functions are implemented by pass-by-call by the compiler. They often put parameters into a temporary function and then put This temporary function is passed into the function body. This temporary function is called the Thunk function. Evaluation strategy Compiler evaluation strategies are usually divided… Read More »

Implement reverse RPC calls in Go

Generally, RPC is based on the C/S structure. The RPC server corresponds to the network server, and the RPC client corresponds to the network client. However, for some unique scenarios, such as providing an RPC service on the company’s intranet, but unable to connect to the intranet’s server on the external network. At this time, we can refer… Read More »

What is access control in cloud computing?

Introduction Access control is to provide a set of methods to identify, organize, and host all functions in the system, organize, and identify all data, and then offer a unique and straightforward interface. One end of this interface is the application. At one end of the system is the permission engine. The permission engine only answers: Does anyone… Read More »