Something about C

2023-11-11

What the hell? How long since I touch with C?
What a pity, I have to work with it now.

Global variable
Better define a global.h, define variable as
extern int i;

And when U use it in another C, do as
unsigned char SysEventCounter = 0;
U can do it in one C file, if U do it in another C file, it will broadcast error.

Operator
Sometimes U encounter & and &&, what’s difference between them? & is bit operator for instance: 5 & 3 = 3; As for &&, a logical operator, 1 && 3 = 1.

Pointer
To allocation two dimension dynamic array:

#include <malloc.h>
reconstructedMVField**MVField;
MVField=(reconstructedMVField**)malloc((picSizeY>>2) * sizeof(reconstructedMVField *));
for(j = 0; j < (picSizeY >> 2); j++)
{
    MVField[j]=(reconstructedMVField*)malloc((picSizeX>>2) * sizeof(reconstructedMVField));
}  
for(j = 0; j < (picSizeY >> 2); j++)
    free(MVField[j]);
free(MVField);

This guy’s blog is not bad.

http://www.cnblogs.com/chenwenbiao/archive/2011/11/04/2236679.html

http://blog.sina.com.cn/s/blog_5d6189e50100bbnd.html

http://blog.sina.com.cn/s/blog_67299aec0100mqek.html

http://zhidao.baidu.com/link?url=4pICOIhwQAtDmMO3LYT-rKMCY-OQWsQJ2TjKGQM56I_wCit92g_s1IaXoMODJOEzpXUol_CItlPVv6AnXBOCbq

MVField **a;
MVField *temp;
a = (MVField**)malloc(10*sizeof(MVField*));

for (int i = 0; i < 10; i++)
    a[i] = (MVField*)malloc(9*sizeof(MVField));

for (int i = 0; i < 10; i++)
{
    temp = a[i];
    for (int j = 0; j < 9; j++)
    {
        (*temp).priority = i + j;
        (*temp).MVdistance = 0;
        (*temp).location.X = j;
        (*temp).location.Y = i;
        *temp++;
    }
}

http://blog.csdn.net/happen23/article/details/4710368

Type Transition

double temp_mvX = 0;
double temp_mvY = 0;
int mvX;
int mvY;    
int index_X = 0;
int index_Y = 0;
int region_cover_X = 0;
int region_cover_Y = 0;
temp_mvX = round( (refPic->mv_info[i_row][j_column]).mv[0].mv_x/4.0 );  // X MV in pixel 
temp_mvY = round( (refPic->mv_info[i_row][j_column]).mv[0].mv_y/4.0 );  // Y MV in pixel
                // to get which region the 4x4 block has covered
mvX = temp_mvX;
mvY = temp_mvY;
region_cover_X = (mvX >= 0) ? (mvX % 4) : ((4 - abs(mvX) % 4)%4);
region_cover_Y = (mvY >= 0) ? (mvY % 4) : ((4 - abs(mvY) % 4)%4);
index_X = j_column + mvX / 4;  // to index block position
index_Y = i_row + mvY / 4;

-> and .
If pointer, “->”
else “.”
But it doesn’t matter, as compiler will tell U.

Multiple Dimension
Be careful of X and Y. Hehe!

Defines like Taps

#ifdef  ERC_BYCOPY_YUV
#undef  ERC_BYCOPY_YUV
#endif
#define IntraMBinSliceAndMBNumInSlice   "D:/CY/JM18_6_RC/scene_change_p_slice.txt"
#if (DEBUG_OPEN == 1)
    FILE *erc_dec_mv_info = NULL;
    recfr.p_Vid = p_Vid;
    VideoParameters *p_Vid1 = recfr.p_Vid;
    StorablePicture* refPic = p_Vid1->ppSliceList[0]->listX[0][0];//p_Vid->ppSliceList[0]->listX[0][0];
    #if(DEBUG_INFO_FOR_MV == 1)
        erc_dec_mv_info = fopen(DEBUG_INFO_FOR_MV_TXT, "a+");
        if(p_Vid->dec_picture->frame_num == 3)  // Just look the second frame's mv information and be attention to the start frame and end frame in Concealment_CY.h 
        {
            for(i_row = 0;i_row < ((*dec_picture)->size_y) /4 ;i_row++)
            {
                for(j_column = 0;j_column < ((*dec_picture)->size_x) / 4;j_column++)
                {
                    fprintf(erc_dec_mv_info, "(%d,%d) -> (%d,%d)->(%d,%d)  ,",i_row,j_column,(refPic->mv_info[i_row][j_column]).mv[0].mv_x,(refPic->mv_info[i_row][j_column]).mv[0].mv_y,(refPic->mv_info[i_row][j_column]).ref_idx[0],(refPic->mv_info[i_row][j_column]).ref_idx[1]);
                }
                fprintf(erc_dec_mv_info,"\n");
            }
            fclose(erc_dec_mv_info);
        }
    #endif
#endif

Bad Code

#define  _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <math.h>
#include <malloc.h>

#define LENCorrupetedBLKMVList sizeof(CorrupetedBLKMVList)
#define AddrNull  0

typedef struct motion_vector
{
    int mvX;
    int mvY;
} ercMV;

// This struct means that the reconstructed MV of each 4x4 block
typedef struct important_POS
{
    int Block_X;  // Here is just for P frame. 
    int Block_Y;            // 1 means the best suit, next 2, then 3, then 4, then 5 and other number means this mv is empty.
}Position;

void simpletest(ercMV Cst_mv){
    printf("%d  %d\n",Cst_mv.mvX,Cst_mv.mvY);
}

typedef struct Corrupted_Per_Block_Ref_MV_Field_Information
{
    Position PPixle;
    ercMV   estiMV;
    int *  pixel;   // With chroma and luma 
}RefBLKMVInfor;

// This struct is used for every corrupted block  
typedef struct Corrupted_Block_MV_List
{
    RefBLKMVInfor  blkInfor;
    struct Corrupted_Block_MV_List* next;
}CorrupetedBLKMVList;

/*!
 ************************************************************************
 * \brief
 *      To create MV list for block in corrupted frameMV field.
 * \return
 *      Pointer of struct CorrupetedBLKMVList.
 * \param NONE
 * \2015/10/9 14:56:30
 ************************************************************************
 */
CorrupetedBLKMVList* CreateMVFieldPerBlockMVListHead(void)
{
    CorrupetedBLKMVList* head;   
    head = (CorrupetedBLKMVList*)malloc(LENCorrupetedBLKMVList);
    head -> next = AddrNull;

    return head;
}

/*!
 ************************************************************************
 * \brief
 *      To insert MV block node  for block in corrupted frameMV field.
 * \return
 *      Pointer head of struct CorrupetedBLKMVList.
 * \param NONE
 * \2015/10/9 14:56:30
 ************************************************************************
 */
void InsertMVNodeIntoBlockList(CorrupetedBLKMVList* head, RefBLKMVInfor  insertData, int blockSize)
{
    CorrupetedBLKMVList*temp;
    int i;
    temp = AddrNull;
    temp = (CorrupetedBLKMVList*)malloc(LENCorrupetedBLKMVList);
    if(temp == AddrNull)
    {
        printf("Error:In malloc memory for CorrupetedBLKMVList\n");
        return; 
    }   

    temp -> next = AddrNull;
    temp -> blkInfor.PPixle.Block_X =  insertData.PPixle.Block_X;
    temp -> blkInfor.PPixle.Block_Y =  insertData.PPixle.Block_Y;
    temp -> blkInfor.estiMV.mvX =  insertData.estiMV.mvX;
    temp -> blkInfor.estiMV.mvY = insertData.estiMV.mvY;
    temp -> blkInfor.pixel = (int*)malloc(blockSize*sizeof(int));

    for(i = 0; i < blockSize; i++)
    {
        temp -> blkInfor.pixel[i] = insertData.pixel[i];
    }

    head -> next = temp;
}

int main()
{
    int i = 0;
    const int blockSize = 16;

    RefBLKMVInfor  testInsertData;
    RefBLKMVInfor  testInsertData2;

    // Create node
    CorrupetedBLKMVList* test_create = AddrNull;
    CorrupetedBLKMVList* search = AddrNull;
    test_create = CreateMVFieldPerBlockMVListHead();
    if (test_create->next == AddrNull)
        printf("Good!\n");
    if(test_create != AddrNull)
        printf("Create OK:%d \n",test_create);

    //  Insert node
    testInsertData.pixel = (int*)malloc(blockSize*sizeof(int));

    for(i = 0; i < blockSize; i++)
    {
        testInsertData.pixel[i] = i;
    }
    testInsertData.PPixle.Block_X = 1;
    testInsertData.PPixle.Block_Y = 2;
    testInsertData.estiMV.mvX = 3;
    testInsertData.estiMV.mvY = 5;

    testInsertData2.pixel = (int*)malloc(blockSize*sizeof(int));

    for (i = 0; i < blockSize; i++)
    {
        testInsertData2.pixel[i] = i+1;
    }
    testInsertData2.PPixle.Block_X = 100;
    testInsertData2.PPixle.Block_Y = 21;
    testInsertData2.estiMV.mvX = 23;
    testInsertData2.estiMV.mvY = 15;

    InsertMVNodeIntoBlockList(test_create, testInsertData, blockSize);
    InsertMVNodeIntoBlockList(test_create, testInsertData2, blockSize);
    InsertMVNodeIntoBlockList(test_create, testInsertData, blockSize);
    search = test_create;

    while (search != AddrNull)
    {
        printf("%d\n", search);
        printf("%d\n", search->blkInfor.PPixle.Block_X);
        printf("%d\n", search->blkInfor.PPixle.Block_Y);
        printf("%d\n", search->blkInfor.estiMV.mvX);
        printf("%d\n", search->blkInfor.estiMV.mvY);
//      printf("%d\n", search->blkInfor.pixel[5]);
        search = search->next;
    }

    search = test_create;

    while (search->next != AddrNull)
    {
    //  free(search->blkInfor.pixel);
        search = search->next;
    }

    free(testInsertData.pixel); 
    free(testInsertData2.pixel);
    system("pause");
    return 0;
}

Good List

#define  _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <math.h>
#include <malloc.h>

#define LENCorrupetedBLKMVList sizeof(CorrupetedBLKMVList)
#define AddrNull  0

typedef struct motion_vector
{
    int mvX;
    int mvY;
} ercMV;

// This struct means that the reconstructed MV of each 4x4 block
typedef struct important_POS
{
    int Block_X;  // Here is just for P frame. 
    int Block_Y;            // 1 means the best suit, next 2, then 3, then 4, then 5 and other number means this mv is empty.
}Position;

void simpletest(ercMV Cst_mv){
    printf("%d  %d\n",Cst_mv.mvX,Cst_mv.mvY);
}

typedef struct Corrupted_Per_Block_Ref_MV_Field_Information
{
    Position PPixle;
    ercMV   estiMV;
    int *  pixel;   // With chroma and luma 
}RefBLKMVInfor;

// This struct is used for every corrupted block  
typedef struct Corrupted_Block_MV_List
{
    RefBLKMVInfor  blkInfor;
    struct Corrupted_Block_MV_List* next;
}CorrupetedBLKMVList;

/*!
 ************************************************************************
 * \brief
 *      To create MV list for block in corrupted frameMV field.
 * \return
 *      Pointer of struct CorrupetedBLKMVList.
 * \param NONE
 * \2015/10/9 14:56:30
 ************************************************************************
 */
CorrupetedBLKMVList* CreateMVFieldPerBlockMVListHead(void)
{
    CorrupetedBLKMVList* head;   
    head = (CorrupetedBLKMVList*)malloc(LENCorrupetedBLKMVList);
    head -> next = AddrNull;

    return head;
}

/*!
 ************************************************************************
 * \brief
 *      To insert MV block node  for block in corrupted frameMV field.
 * \return
 *      Pointer head of struct CorrupetedBLKMVList.
 * \param NONE
 * \2015/10/9 14:56:30
 ************************************************************************
 */
CorrupetedBLKMVList* InsertMVNodeIntoBlockList(CorrupetedBLKMVList* head, RefBLKMVInfor  insertData, int blockSize)
{
    CorrupetedBLKMVList*temp = AddrNull;
    int i;

    if (head == AddrNull)  // first node
    {
        head = (CorrupetedBLKMVList*)malloc(LENCorrupetedBLKMVList);
        head->next = AddrNull;
        head->blkInfor.PPixle.Block_X = insertData.PPixle.Block_X;
        head->blkInfor.PPixle.Block_Y = insertData.PPixle.Block_Y;
        head->blkInfor.estiMV.mvX = insertData.estiMV.mvX;
        head->blkInfor.estiMV.mvY = insertData.estiMV.mvY;
        head->blkInfor.pixel = (int*)malloc(blockSize*sizeof(int));

        for (i = 0; i < blockSize; i++)
        {
            head->blkInfor.pixel[i] = insertData.pixel[i];
        }
    }
    else
    {
        temp = (CorrupetedBLKMVList*)malloc(LENCorrupetedBLKMVList);

        if (temp == AddrNull)
        {
            printf("Error:In malloc memory for CorrupetedBLKMVList\n");
            return;
        }

        temp->blkInfor.PPixle.Block_X = insertData.PPixle.Block_X;
        temp->blkInfor.PPixle.Block_Y = insertData.PPixle.Block_Y;
        temp->blkInfor.estiMV.mvX = insertData.estiMV.mvX;
        temp->blkInfor.estiMV.mvY = insertData.estiMV.mvY;
        temp->blkInfor.pixel = (int*)malloc(blockSize*sizeof(int));

        for (i = 0; i < blockSize; i++)
        {
            temp->blkInfor.pixel[i] = insertData.pixel[i];
        }

        temp->next = head;
        head = temp;
    }
    return head;
}

int main()
{
    int i = 0;
    const int blockSize = 16;

    RefBLKMVInfor  testInsertData;
    RefBLKMVInfor  testInsertData2;

    // Create node
    CorrupetedBLKMVList* test_create = AddrNull;
    CorrupetedBLKMVList* search = AddrNull;

    if(test_create != AddrNull)
        printf("Create OK:%d \n",test_create);

    //  Insert node
    testInsertData.pixel = (int*)malloc(blockSize*sizeof(int));

    for(i = 0; i < blockSize; i++)
    {
        testInsertData.pixel[i] = i;
    }
    testInsertData.PPixle.Block_X = 1;
    testInsertData.PPixle.Block_Y = 2;
    testInsertData.estiMV.mvX = 3;
    testInsertData.estiMV.mvY = 5;

    testInsertData2.pixel = (int*)malloc(blockSize*sizeof(int));

    for (i = 0; i < blockSize; i++)
    {
        testInsertData2.pixel[i] = i+1;
    }
    testInsertData2.PPixle.Block_X = 100;
    testInsertData2.PPixle.Block_Y = 21;
    testInsertData2.estiMV.mvX = 23;
    testInsertData2.estiMV.mvY = 15;

    test_create = InsertMVNodeIntoBlockList(test_create, testInsertData, blockSize);
    test_create = InsertMVNodeIntoBlockList(test_create, testInsertData2, blockSize);
    test_create = InsertMVNodeIntoBlockList(test_create, testInsertData, blockSize);
    search = test_create;

    while (search != AddrNull)
    {
        printf("%d\n", search);
        printf("%d\n", search->blkInfor.PPixle.Block_X);
        printf("%d\n", search->blkInfor.PPixle.Block_Y);
        printf("%d\n", search->blkInfor.estiMV.mvX);
        printf("%d\n", search->blkInfor.estiMV.mvY);
//      printf("%d\n", search->blkInfor.pixel[5]);
        search = search->next;
    }

    search = test_create;

    while (search->next != AddrNull)
    {
    //  free(search->blkInfor.pixel);
        search = search->next;
    }

    free(testInsertData.pixel); 
    free(testInsertData2.pixel);
    system("pause");
    return 0;
}

Malloc Two Dimension Pointer
I think the code I write is so beautiful!

    CorrupetedBLKMVList*** Pic;
    Pic = (CorrupetedBLKMVList***)malloc(height*sizeof(CorrupetedBLKMVList**));

    for(j = 0; j < height;j++)
    {
        Pic[j] = (CorrupetedBLKMVList**)malloc(width*sizeof(CorrupetedBLKMVList*));
    }   
    for(j = 0; j < height;j++)
    {
        free(Pic[j]);
    }
    free(Pic);

Flexible Pointer Using

static void GetLumaBlock10(imgpel **block, imgpel **imgY, int blockSizeX, int blockSizeY, int XPosPixel, int YPosPixel, int maxImgpelValue)
{
    imgpel *p0, *p1, *p2, *p3, *p4, *p5;
    imgpel *orig_line, *cur_line;
    int i, j;
    int result;

    for (j = 0; j < blockSizeY; j++)
    {
        cur_line = &(cur_imgY[j][XPosPixel]);
        p0 = &cur_imgY[j][XPosPixel - 2];
        p1 = p0 + 1;
        p2 = p1 + 1;
        p3 = p2 + 1;
        p4 = p3 + 1;
        p5 = p4 + 1;
        orig_line = block[j];            

        for (i = 0; i < blockSizeX; i++)
        {        
            result  = (*(p0++) + *(p5++)) - 5 * (*(p1++) + *(p4++)) + 20 * (*(p2++) + *(p3++));
            *orig_line = (imgpel) iClip1(maxImgpelValue, ((result + 16)>>5));
            *orig_line = (imgpel) ((*orig_line + *(cur_line++) + 1 ) >> 1);
            orig_line++;
        }
    }
}

Divide
‘&’ is a excellent operation. Just think that (-5) & 3 = 3, you will get the right result of U want.
‘%’ is another operation that (-5) % 4 = -1
‘a & b’ can be get by ‘b < 0? (b - abs(a%b)) : (a%b)’
I found that the operation is excellent.
(-3) >> 2 = -1 <=> (int)floor((-3.0)/4.0)
(-3)/4 = 0 <=> (int)ceil((-3.0)/4.0)

Create Files and Copy String

const char* s = "../../new3";

is the same as

#define s "../../new3"
#include <stdio.h>
#include <math.h>
#include <malloc.h>
#include <process.h>
#include <direct.h>
#include <sys/stat.h>
#include <string.h>

static void try_create_dir(const char* dest_dir)
{
    if (_access(dest_dir, 0) != 0)
    {
        _mkdir(dest_dir);
    }
}

int main()
{
    const char* s = "../../new3";
    char s1[100];
    FILE *f1 = NULL;

    try_create_dir(s);

    strcpy(s1, s); 
    strcat(s1,"/file1.txt" ); 

    if ((f1 = fopen(s1, "w+")) == NULL)
    {
        printf("Error in create log file of reconstructed MV field.\n");
    }

    fprintf(f1, "----------------------Successful-------------------------------------\n");

    fclose(f1);

    system("pause");
    return 0;
}

VS Skills
1、improve Ur VS running speed:

http://www.jb51.net/os/windows/73851.html
2、Condition Breakpoint:
Double click then tight click on the breakpoint and set condition:
for instance:
pxlLocation.Y == 0x110

MEMCPY
For two dynamic arrays copy by memcpy, be careful of data type.

// Y component assignment.
        frame_ref->imgY_ref = (imgPel**)malloc(tempHeight * sizeof(imgPel*));

        for(i = 0; i < tempHeight; i++)
        {
            frame_ref->imgY_ref[i]=(imgPel*)malloc(tempWidth * sizeof(imgPel));
            if(refPic->imgY[i] != NULL)
            {   
                memcpy(frame_ref->imgY_ref[i], refPic->imgY[i], tempWidth * sizeof(imgPel));
            }
        }  

C-free using and debug skills

http://www.programarts.com/cfree_ch/doc/help/UsingCF/Debug.htm
http://www.cnblogs.com/lidabo/p/3631224.html

C File Operetion

http://blog.csdn.net/gneveek/article/details/6848473
http://www.cppblog.com/Tongy0/archive/2014/03/23/206305.html

C Using Skill As 默认参数

http://blog.sina.com.cn/s/blog_933d4eec0100vdk0.html

Stack Overflow

http://www.cnblogs.com/fanzhidongyzby/archive/2013/08/10/3250405.html

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Something about C 的相关文章

  • 专题五 Redis高并发场景

    介绍 Redis高并发场景 如果直接去学会比较抓不住头绪 因此本文将一步步介绍Redis的高并发的步骤演进 首先解释synchronized不适合在分布式场景 因为synchronized只适用自身的JVM 因此在分布式场景下多台机器的情况
  • 用IEDA开发WEB项目发生的java.lang.NoClassDefFoundError解决方法

    编译的时发生了这个问题 然后上网上百度了一下 一下出自于别人的博客 一 第一种 也是新手容易犯的错误 那就是classpath环境变量配置错误 这个错误在我最开始学习Android的时候就遇到过 弄的焦头烂额的 解决办法 在系
  • 华为机试:计算某字母出现次数 (不区分大小写)

    一 题目 描述 写出一个程序 接受一个由字母 数字和空格组成的字符串 和一个字母 然后输出输入字符串中该字母的出现次数 不区分大小写 字符串长度小于500 输入描述 第一行输入一个由字母和数字以及空格组成的字符串 第二行输入一个字母 输出描
  • 【华为OD机试】数字最低位排序【2023 B卷

    华为OD机试 真题 点这里 华为OD机试 真题考点分类 点这里 题目描述 给定一个非空数组 列表 起元素数据类型为整型 请按照数组元素十进制最低位从小到大进行排序 十进制最低位相同的元素 相对位置保持不变 当数组元素为负值时 十进制最低为等

随机推荐

  • 集合引用类型 下

    目录 Map Map set Map get Map delete Map has Map values Map entries Map clear 选择Object 还是Map 数据转换 转为数组 转为 JSON 对象转为 Map 数组转
  • 【Matlab】系统的响应分析

    前言 一个信号系统课程中使用Matlab对系统的零状态响应 零输入响应 完全响应 冲激响应 阶跃响应求解 波形生成以及分析的实验 一 内容 设系统的微分方程为 激励为 起始状态条件为 可求得 零输入响应 零状态响应 完全响应 冲激响应 阶跃
  • 攻防世界web新手题解题writeup

    攻防世界web新手题 1 view source 题目描述 X老师让小宁同学查看一个网页的源代码 但小宁同学发现鼠标右键好像不管用了 题目场景 http 220 249 52 133 58537初级题 按下F12查看网页源码得到flag 2
  • vue自定义指令实现复制功能

    思路 使用浏览器自带的execCommand使用Copy 但此方法只能是被选中的值才能进行复制粘贴 动态创建一个文本域 将拿到的文字放在文本域中 然后自动选中 再调用浏览器方法即可 提示 想要选中文本框的内容 有如下两个方法可以 方法一 通
  • 用python画一束满天星花朵,python满天星绘制流程图

    大家好 小编来为大家解答以下问题 用python画一束满天星花朵 python满天星绘制流程图 今天让我们一起来看看吧 1 用python画一百个同心圆的代码 import matplotlib pyplot as plt from mat
  • u盘文件删除如何恢复呢?

    相信很多上班族都有自己的u盘 u盘是用来储存一些我们可以随身携带的数据的 无论是学习还是工作 只要用电脑 都需要使用u盘 而u盘就是一个小容器 可以装一些重要的文件 方便我们随身携带 当u盘里的文件在使用u盘的过程中不小心被删除了 怎么恢复
  • selenium的安装及使用介绍

    R爬虫之上市公司公告批量下载 selenium的安装及使用介绍 http yphuang github io blog 2016 03 01 Get Listed Company Announcement
  • 【超简单】使用TensorFlow训练和部署图像分类模型

    一 简介 使用TensorFlow和OpenCV实现图像分类 按照流程图运行程序 可以非常简便地完成图像预处理 生成数据集 训练模型和部署模型 四个程序的功能如下 preprocess py 对图像进行重命名和调整大小 建议拍摄形状为正方形
  • 数据流图学习

    数据流图或数据流程图 Data Flow Diagram 缩写为DFD 是什么 数据流图是结构化分析方法中使用的工具 它以图形的方式描绘数据在系统中流动和处理的过程 由于它只反映系统必须完成的逻辑功能 所以它是一种功能模型 标志了一个系统的
  • JavaScript中apply()和call()的区别和应用

    JavaScript中的每一个Function对象都有一个apply 方法和一个call 方法 这两个方法能够改变函数体内部 this 的指向 例如 fun1 call 或者fun1 apply 都是为了改变fun1函数内部的this指向
  • Java 实现 AES 对称加密算法的加解密

    Java 实现 AES 对称加密算法的加解密 前言 一 对称加密算法简介 1 对称加密 2 加密模式 3 填充模式 二 AES 加解密代码实例 1 生成 AES 密钥 2 AES 加解密 3 AES nonce 加解密 前言 文章字数比较多
  • uniapp 里折叠面板嵌套 uni-collapse 高度不能自适应解决办法

  • python:根据一个列表对另外一个列表排序

    在使用python处理数据时可能会遇到根据列表A对列表B进行排序的问题 记录一下想到的两个方法 方法1 根据列表b中每个元素的下标来获取列表a中对应位置的元素 将其作为排序依据即可 import random a x for x in ra
  • JVM你知道多少?

    1 jvm的内存结构 方法区和堆是所有线程共享的内存区域 而java栈 本地方法栈和程序计数器是运行时线程私有的内存区域 1 Java堆 Heap 是Java虚拟机所管理的内存中最大的一块 Java堆是被所有线程共享的一块内存区域 在虚拟机
  • naive bayes java_Naive Bayes 朴素贝叶斯的JAVA代码实现

    最进写毕业论文找了下贝页斯的资料 这个文章讲的很好 转载下 链接http blog csdn net michael kong nju article details 12623557 comments 1 关于贝叶斯分类 bayes 是一
  • STM32—ADC详解入门(ADC读取烟雾传感器的值)

    目录 一 ADC是什么 二 ADC的性能指标 三 ADC特性 四 ADC通道 五 ADC转换顺序 六 ADC触发方式 七 ADC转化时间 八 ADC转化模式 九 实验 使用ADC读取烟雾传感器的值 1 配置 2 代码 一 ADC是什么 AD
  • MSYS2更换国内源

    今天安装了Msys64 但是Msys64使用的国外源实在太慢 必须更新为国内源 目前测试过国内最快是清华大学的源 我的安装路径为d msys64 为什么要安装在D盘 因为msys64需要不断更新数据和安装自己的软件 也就是说会占用越来越多的
  • 使用mnist数据集实现手写字体的识别

    1 MNIST是一个入门级的计算机视觉数据集 它包含各种手写数字图片 它也包含每一张图片对应的标签 告诉我们这个是数字几 该数据集包括60000行的训练数据集 mnist train 和10000行的测试数据集 mnist test 每一张
  • mysql索引左侧原则,你真的了解吗?

    前言 写这篇文章源自一位杠精同事提了个问题 左侧原则跟where条件顺序有无关系 我想了想 好像是有关系的 不敢确定 但是自己又懒得动手测试 于是发起ETC自动抬杠功能 强行杠了一拨 结果杠输了 接下来即是动手验证 预习执行计划 实践 咱们
  • Something about C

    What the hell How long since I touch with C What a pity I have to work with it now Global variable Better define a globa