Tag:file name

  • Image compression script


    1 Overview Using the convert command to do a small image compression script, only one parameter is required to specify the compression quality, which will compress the JPG / jpeg / PNG of the current folder. sh compress.sh 75 After the compression is completed, the maximum, minimum and average compression ratio are displayed. 2. Main […]

  • Batch listing of all file names


    Quickly list all file names in the directory.Usage: save the following code in *. Bat format, put it in the target root directory and double-click it Copy codeThe code is as follows: @echo off set startDir = %CD% if(%1)==(‘help’) GOTO USAGE IF (%1)==() ( set work_dir=%cd% ) ELSE ( set work_dir=%1 ) cd /d %1 […]

  • PHP calls GitHub API combined with jsdelivr for object storage (file hyperlink)


    This article first appeared on my blog https://huanghaozi.cn , original link Yesterday, when I was in the water group, I found that in order to facilitate the management, the group owner set up the group file, which can only be uploaded by the administrator. For such a large group, it can prevent many problems, but […]

  • C serialization 3 – C in different environments


    1、 C in different environments 1. A source program information. C is compiled to generate a.out, and then the executable program can be directly run. If you want to store this executable file, you should rename it, otherwise, it will be replaced by the new a.out generated in the next program compilation. 2. How to […]

  • Using Python script to uniformly rename the training picture file name


    Yolo algorithm often uses VOC data format in model training. To copy the image file to the jpegimages directory, you need to rename the file name with VOC standard format number, such as 2020_ 000001.jpg,2020_ 00000 2.jpg, which is convenient for VOC_ label.py For subsequent processing. If this work is done by hand, it is […]

  • IOS saves the picture to the album and gets an instance of the image file name


    Examples are as follows: – (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage]; if (picker.sourceType == UIImagePickerControllerSourceTypeCamera) { UIImageWriteToSavedPhotosAlbum(image,self,@selector(image:didFinishSavingWithError:contextInfo:),NULL); } } – (void)image:(UIImage*)image didFinishSavingWithError:(NSError*)error contextInfo:(void*)contextInfo { if (error) { Dlog (@ “picture save failed! “”; }else{ Dlog (@ “picture saved successfully! “”; } } This method can save pictures from other sources to […]

  • The general process of “smoke test” for webpack packaged projects with mocha


    Step 1: delete the ‘. / dist’ directory before packaging startsrimraf(‘./dist’, () => { constprodConfig = require(‘../../lib/webpack.prod’) webpack(prodConfig, (err, stats) \=> { if (err) {  console.log(err)  process.exit(2)     } console.log(stats.toString({ color:true, modules:false, children:false     })) //Step 3: add the test rules to the package mocha.addFile(resolve(\_\_dirname, ‘./html-test.js’)) mocha.addFile(resolve(\_\_dirname, ‘./css-js-test.js’)) mocha.run() }) }) Step 2: create a new test rule const glob = require(‘glob’); describe(‘Checking generated html files’,() \=> { it(‘should generate html files’, (done) \=> { constfiles = glob.sync(‘./dist/+(index|search).html’) if (files.length) { done()     } else { thrownewError(‘no html files generated’)     }   }); }); […]

  • 2、 Shell variable


    Shell variable Shell variables are divided into local variables and environment variables Defining and using local variables #!/bin/bash #Use: the use of local variables #By authors: wl_it 2020.05.05 #Name = Jack. Comments can follow If the value needs a space, use double quotation marks echo “My name is $name” Echo $UID ා using system environment […]

  • Bash tip: you can batch shell scripts with numbers in front of multiple directory names


    This article introduces a shell script that can batch add numbers to multiple directory names. Suppose the name of the shell script isdigitname.sh。 In the actual development work, the number will be added in front of the commonly used important catalog. For example, name the directory in the form of “1-development document” and “2-department document”. […]

  • How to solve “could’t read native” when typora failed to export word


    problem Typora has pandoc installed, but exporting word (. Docx) failed.Here’s a hintcouldn’t read native。 reason After testing, it is found that if the MD file contains tables, it will fail to export word documents. solve Method 1: backup the table in MD file, delete the table, export the rest to word, and finally manually […]

  • Axios download, monitor the file download progress, achieve the progress bar function; get the download file name and extension


    1. Reference: https://blog.csdn.net/yoinyao/article/details/99861256 2. In react, Axios downloads the file, monitors the file download progress, and the original file name and file extension 3. Project address: https://gitee.com/beiysd/react-template 4. The source code of the home page is as follows: /** * @name DownLoad *@ description download progress bar */ import React, { Component } from “react”; import […]

  • Django realizes file download


    def download_user_record_excel(request): req_params = request.GET logger_request(req_params) try: start_date = req_params.get(‘start_date’) end_date = req_params.get(‘end_date’) excel_ name = str(start_ Date) + “to” + str (end)_ Date) + “user usage record. Xlsx” excel_path_name = ‘./report/{}’.format(excel_name) save_user_record_to_excel(start_date, end_date, excel_path_name) file = open(excel_path_name, ‘rb’) response = FileResponse(file) response[‘Content-Type’] = ‘application/octet-stream’ #Please note that the methods found on the Internet are […]