通讯录

通讯录管理系统简单实现 今天我们要实现的通讯录管理系统主要有7项功能:添加联系人,显示联系人,删除联系人,查找联系人,修改联系人,清空联系人,退出通讯录。 阅读详情

一、目标描述:

1、建立一个通讯录,按姓名字母排序存储联系人信息。

2、可显示菜单提供显示、新增、删除、修改等功能。

3、显示:(1)显示联系人数量及全部联系人信息;(2)提供特定条件查询指定联系人信息。

4、新增:逐步提示对应信息输入。

5、删除:删除指定联系人信息。

6、修改:提供特定条件修改指定单个联系人信息:先显示原先信息,再提供选项修改对应条目。

7、通讯录信息保存在文件中。

二、目标分析:

1、项目需要排序、新增,则考虑使用二叉搜索树来建立数据堆模型。

2、该模型须提供以下具体功能模块:(1)初始化(2)新增项目(3)删除(4)查询有无(5)修改

3、信息要保存到文件中,每一次更新信息都要对应到文件中;则上述功能模块都要增加读写文件功能才能更新文件,这是一个复杂而且现阶段我很难实现的工作,只考虑下面一种很笨拙但相对简单的实现方式:在上述功能模块中:(2)新增(3)删除(5)修改功能后提供文件更新,同时文件更新不针对某条具体的(新增的或删除的或修改的)信息,而是对应功能完成后文件按整个通讯录重新写入。因此增加功能模块(6)将整个二叉树信息依序写入文件。

4、程序第一次运行,文件信息为空,通过程序新增录入信息,并且文件得以更新,这没有问题。可第二次,第三次运行呢?文件已经存在,而且已经有信息了,可程序运行之初二叉树数据堆是空的,怎样读取文件中的信息,并写入二叉树模型呢?

如果在文件中联系人信息如下设置:

"Name:""-Bir_Year:""-..."可通过文本字符串判断然后写入二叉树的节点;另外一点,选择按姓名比较建立二叉树。同时,每个联系人信息结尾用换行符进行标记。

三、功能模块的具体思路

1、初始化

先读取文本,建立二叉树联系人模型;若文本为空,则初始化空树。

2、新增

提示输入姓名,写入相关信息,建立节点,依据姓名找到合适位置插入二叉树。依据更新的二叉树,重新写入文本。

3、删除

提示输入被删姓名,删除该节点。依据更新的二叉树,重新写入文本。

4、查询有无

提示输入查询条件,找到相关信息并显示。该模块为功能2、3、5提供支持。

5、修改

提示输入被修改姓名,修改操作。依据更新的二叉树,重新写入文本。

#include<stdio.h>
#include<string.h>
#include<stdlib.h>

void IniTree();
void AddNode();
void ChoiceAdd();
void ShowTree();
int SeekName();
void ChoiceDel();
void DeleteNode();
void Choicefind();
void Choicemod();
void ShowMainInterface();
void NodeWrite();



typedef struct member
{
   char name[20];
   char sex;
   char bir_year[5];
   char bir_month[3];
   char bir_day[3];
   char qq[15];
}Member;

typedef struct node
{
   Member *person;
   struct node *left;
   struct node *right;
}Node;

typedef struct tree
{
   Node *root;
   int numbers;
}Tree;



void ShowMainInterface()
{
  printf("Input your choice:\n");
  printf("a)show all friends.\n");
  printf("b)add a friend's information.\n");
  printf("c)modify a friend's information.\n");
  printf("d)delete a friend.\n");
  printf("e)look for a friend's information.\n");
  printf("q)Quit.\n");
}
void IniTree(Tree *ptree)
{
  FILE *fp;
  Node *newnode;
  int i=0;
  char name[20];
  char sex;
  char bir_year[5];
  char bir_month[3];
  char bir_day[3];
  char qq[15];
  char ch;
  fp=fopen("c.txt","r");
//如果文件不存在,则初始化二叉树
  if(fp==NULL)
  {
     ptree->root=NULL;
     ptree->numbers=0;
     printf("FILE Error!\n");
  }
//文件存在,则读入文件,创建二叉树节点信息
  else
  {
  ch=getc(fp);
//每个换行符前为一个联系人信息,每行建一个节点
//读文件前,先初始化树
  ptree->root=NULL;
  ptree->numbers=0;
  while(ch!=EOF)
  {
   while((ch!='\n')&&(ch!=EOF))
   {
     newnode=(Node*)malloc(sizeof(Node));
     while(ch!='-')
     { 
         newnode->person->name[i]=ch;
         i++;
         ch=getc(fp);
     }
     newnode->person->name[i]='\0';
//姓名信息录入完毕,重置i,继续读取下一个字符
     i=0;
     ch=getc(fp);
     while(ch!='-')
     { 
         newnode->person->sex=ch;
         ch=getc(fp);
     }
//性别信息录入完毕,重置i,继续读取下一个字符
     i=0;
     ch=getc(fp);
     while(ch!='-')
     { 
         newnode->person->bir_year[i]=ch;
     i++;
         ch=getc(fp);
     }
     newnode->person->bir_year[i]='\0';
//出生年信息录入完毕,重置i,继续读取下一个字符
     i=0;
     ch=getc(fp);
     while(ch!='-')
     { 
         newnode->person->bir_month[i]=ch;
     i++;
         ch=getc(fp);
     }
     newnode->person->bir_month[i]='\0';
//出生月信息录入完毕,重置i,继续读取下一个字符
     i=0;
     ch=getc(fp);
     while(ch!='-')
     { 
         newnode->person->bir_day[i]=ch;
     i++;
         ch=getc(fp);
     }
     newnode->person->bir_day[i]='\0';
//出生日信息录入完毕,重置i,继续读取下一个字符
     i=0;
     ch=getc(fp);
     while(ch!='-')
     { 
         newnode->person->qq[i]=ch;
     i++;
         ch=getc(fp);
     }
     newnode->person->qq[i]='\0';
//qq信息录入完毕,该联系人所有信息录入完毕,建立该联系人节点信息,插入树
     newnode->left=NULL;
     newnode->right=NULL;
     AddNode(newnode,ptree);
//此时ch到了行末,为'-'
//继续读取下一个字符
     ch=getc(fp);
    }
//单行节点信息录入完毕,重置i
    i=0;
    ch=getc(fp);
  }
 }
}
     
//使用前须确保无相同节点
void AddNode(Node *node,Tree *ptree)
{
   Node *newnode,*fathernode;
   newnode=ptree->root;
   while(newnode!=NULL)     //找空位,并且定位空位的父节点
   {
         if(strcmp(node->person->name,newnode->person->name)<0)
         {
              fathernode=newnode;      
              newnode=newnode->left;
         }
     else
         {
              fathernode=newnode;      
              newnode=newnode->right;
         }
    } 
       
    if(ptree->root==NULL)  //如果树为空
    {
           ptree->root=node;
           ptree->numbers++; 
    }
    else
    {
         if(strcmp(node->person->name,fathernode->person->name)<0)   //说明父节点左子节点为空
         {    
        fathernode->left=node;
        ptree->numbers++;
     }
         else
         {    
        fathernode->right=node;
        ptree->numbers++;
     }
     }
  
}

void ChoiceAdd(Tree *ptree)
{
  Node *newnode;
  char namex[20];
  printf("please input the name:\n");
  scanf("%s",namex);
  while(getchar()!='\n') continue;
  if(SeekName(namex,ptree->root)==1)
    printf("the person:%s is exist.\n",namex);
  else
  {
    newnode=(Node*)malloc(sizeof(Node));
    strcpy(newnode->person->name,namex);
    printf("\nplease input the sex(F or M):\n");
    scanf("%c",&(newnode->person->sex));while(getchar()!='\n') continue;
    printf("\nplease input the bir_year:\n");
    scanf("%s",newnode->person->bir_year);while(getchar()!='\n') continue;
    printf("\nplease input the bir_month:\n");
    scanf("%s",newnode->person->bir_month);while(getchar()!='\n') continue;
    printf("\nplease input the bir_day:\n");
    scanf("%s",newnode->person->bir_day);while(getchar()!='\n') continue;
    printf("\nplease input the QQ:\n");
    scanf("%s",newnode->person->qq);while(getchar()!='\n') continue;
  
    newnode->left=NULL;
    newnode->right=NULL;
    AddNode(newnode,ptree);
    printf("-----%s information recorded!---------\n",namex);
   }
}

void ShowTree(const Node *root)
{
  Node *newnode;
  newnode=root;
  if(newnode!=NULL)
  {
     ShowTree(newnode->left);
     printf("%s--%c--%s--%s--%s--%s.\n",root->person->name,root->person->sex, 
              root->person->bir_year,root->person->bir_month,
          root->person->bir_day,root->person->qq);
     ShowTree(newnode->right);
  }
}

//查找树中有无指定姓名
//若有返回1,若无返回0
int SeekName(char name[20],const Node *root)
{
   Node *pnode;
   if(root==NULL)
      return 0;
   pnode=root;

   while(pnode!=NULL)
   {  
      if(strcmp(name,pnode->person->name)<0)
      {
     pnode=pnode->left;
      }
      else if(strcmp(name,pnode->person->name)>0)
      {
     pnode=pnode->right;
      }
      else
         return 1;
   }
   return 0;
}


void ChoiceDel(Tree *ptree)
{
  Node *nodef,*nodec;
  char namex[20];
  printf("please input the name:\n");
  scanf("%s",namex);
  if(SeekName(namex,ptree->root)==0)
  {
    printf("the person %s is not exist!\n",namex);
  }
  else
  {
    nodec=ptree->root;
    nodef=NULL;
    while(nodec!=NULL)
    {
       if(strcmp(namex,nodec->person->name)<0)
       {
      nodef=nodec;
      nodec=nodec->left;
       }
       else if(strcmp(namex,nodec->person->name)>0)
       {
      nodef=nodec;
      nodec=nodec->right;
       }
       else
      break;
     }//找到该节点及其父节点
     if(nodef==NULL)
          DeleteNode(&ptree->root);
     else if(nodef->left==nodec)
          DeleteNode(&nodef->left);
     else 
          DeleteNode(&nodef->right);
     ptree->numbers--;
     printf("--------%s is deleted!---------\n",namex);
     
   }
}

//删除结点函数,参数如何描述?
//删除操作后被删除结点的父节点的“指向被删结点的指针成员”要重新赋值
//所以要用指向“父节点指针成员”的指针去描述
//而父节点指针成员本身是一个Node*指针型,所以参数类型为Node **
//注意:这里的ptr是指向父节点指针成员(指向被删结点)的指针类型
//*ptr描述的是父节点中指向被删结点的指针成员,也即被删结点的地址指针类型
//**ptr则是描述被删除的结点类型
void DeleteNode(Node **ptr)
{
  Node *temp;
//*ptr为被删结点父节点的指针成员,该成员指向被删结点,
//(*ptr)->left即指向被删结点的左子节点
//若其左子节点为空,将其右子节点链接到父节点原先指向被删结点的指针成员
  if((*ptr)->left==NULL)   
  {
    temp=*ptr;
    *ptr=(*ptr)->right;
    free(temp);
  }
//若其右子节点为空,将其左子节点链接到父节点原先指向被删结点的指针成员
  else if((*ptr)->right==NULL)
  {
    temp=*ptr;
    *ptr=(*ptr)->left;
    free(temp);
  }
  else  //被删除结点有两个子结点
  {
    for(temp=(*ptr)->left;temp->right!=NULL;temp=temp->right)
        continue;
    temp->right=(*ptr)->right;
    temp=*ptr;
    *ptr=(*ptr)->left;
    free(temp);
  }
} 

void Choicefind(Tree *ptree)
{
  Node *nodef,*nodec;
  char namex[20];
  printf("please input the name:\n");
  scanf("%s",namex);
  if(SeekName(namex,ptree->root)==0)
  {
    printf("the person %s is not exist!\n",namex);
  }
  else
  {
    nodec=ptree->root;
    nodef=NULL;
    while(nodec!=NULL)
    {
       if(strcmp(namex,nodec->person->name)<0)
       {
      nodef=nodec;
      nodec=nodec->left;
       }
       else if(strcmp(namex,nodec->person->name)>0)
       {
      nodef=nodec;
      nodec=nodec->right;
       }
       else
      break;
     }//找到该节点及其父节点
     printf("the person:%s information is followed:\n");
     printf("name:%s\n",nodec->person->name);
     printf("sex:%c\n",nodec->person->sex);
     printf("bir_year:%s\n",nodec->person->bir_year);
     printf("bir_month:%s\n",nodec->person->bir_month);
     printf("bir_day:%s\n",nodec->person->bir_day);
     printf("qq:%s\n",nodec->person->qq);
   }
   printf("input any key to continue...\n");
   getch();
} 


void Choicemod(Tree *ptree)
{
  Node *nodef,*nodec;
  char namex[20];
  char ch;
  printf("please input the name:\n");
  scanf("%s",namex);
  if(SeekName(namex,ptree->root)==0)
  {
    printf("the person %s is not exist!\n",namex);
  }
  else
  {
    nodec=ptree->root;
    nodef=NULL;
    while(nodec!=NULL)
    {
       if(strcmp(namex,nodec->person->name)<0)
       {
      nodef=nodec;
      nodec=nodec->left;
       }
       else if(strcmp(namex,nodec->person->name)>0)
       {
      nodef=nodec;
      nodec=nodec->right;
       }
       else
      break;
     }//找到该节点及其父节点
     printf("--------------------Please choose--------------------\n");
     printf("a)----------modify name----%s\n",nodec->person->name);
     printf("b)----------modify sex----%c\n",nodec->person->sex);
     printf("c)----------modify bir_year----%s\n",nodec->person->bir_year);
     printf("d)----------modify bir_month----%s\n",nodec->person->bir_month);
     printf("e)----------modify bir_day----%s\n",nodec->person->bir_day);
     printf("f)----------modify qq----%s\n",nodec->person->qq);
     printf("q)---------------quit to upperlevel------------------\n");
   
     ch=getch();
     printf("your choice is %c.\n",ch);
     while(getchar()!='\n') continue;
     while(ch!='q')
     {
       while(ch!='a'&&ch!='b'&&ch!='c'&&ch!='d'&&ch!='e'&&ch!='f'&&ch!='q')
       {
      printf("input a or b or c or d or e or f or q.\n"); 
          ch=getchar();
          printf("your choice is %c.\n",ch);
       }
       switch(ch)
       {
    case 'a':
            printf("input %s new name:",nodec->person->name);
            scanf("%s",nodec->person->name);
            while(getchar()!='\n') continue;
            break;
    case 'b':
            printf("input %s new sex:",nodec->person->name);
            scanf("%c",&(nodec->person->sex));
            while(getchar()!='\n') continue;
            break;
    case 'c':
            printf("input %s new bir_year:",nodec->person->name);
            scanf("%s",nodec->person->bir_year);
            while(getchar()!='\n') continue;
            break;
    case 'd':
            printf("input %s new bir_month:",nodec->person->name);
            scanf("%s",nodec->person->bir_month);
            while(getchar()!='\n') continue;
            break;
    case 'e':
            printf("input %s new bir_day:",nodec->person->name);
            scanf("%s",nodec->person->bir_day);
            while(getchar()!='\n') continue;
            break;
    case 'f':
            printf("input %s new QQ:",nodec->person->name);
            scanf("%s",nodec->person->qq);
            while(getchar()!='\n') continue;
            break;
    case 'q':
            break;
       }
       if(ch!='q')
       {
     printf("--------------------Please choose--------------------\n");
     printf("a)----------modify name----%s\n",nodec->person->name);
     printf("b)----------modify sex----%c\n",nodec->person->sex);
     printf("c)----------modify bir_year----%s\n",nodec->person->bir_year);
     printf("d)----------modify bir_month----%s\n",nodec->person->bir_month);
     printf("e)----------modify bir_day----%s\n",nodec->person->bir_day);
     printf("f)----------modify qq----%s\n",nodec->person->qq);
     printf("q)---------------quit to upperlevel------------------\n");
         ch=getch();
         printf("your choice is %c.\n",ch);
       }
       
       
     }
  }
} 


void NodeWrite(const Node *node)
{
   FILE *fp;
   fp=fopen("c.txt","a");
   fprintf(fp,"%s",node->person->name);
   putc('-',fp);
   putc(node->person->sex,fp);
   putc('-',fp);
   fprintf(fp,"%s",node->person->bir_year);
   putc('-',fp);
   fprintf(fp,"%s",node->person->bir_month);
   putc('-',fp);
   fprintf(fp,"%s",node->person->bir_day);
   putc('-',fp);
   fprintf(fp,"%s",node->person->qq);
   putc('-',fp);
   putc('\n',fp);
   fclose(fp);
}

void TreeWrite(const Node *root)
{
   Node *pnode;
   pnode=root;
   if(pnode!=NULL)
   {
     TreeWrite(pnode->left);
     NodeWrite(pnode);
     TreeWrite(pnode->right);
   }
}


int main(void)
{
//变量设置区----------------------------------------
  Tree *ctree;
  char ch;
//变量设置结束--------------------------------------
 
//程序信息区-----------------------------------------
  printf("*******************************************************************\n");
  printf("-----------------------------Address Book--------------------------\n");
  printf("------------------------------Version1.0---------------------------\n");
  printf("-----------------------------By TSEMBRACE--------------------------\n");
  printf("*******************************************************************\n");  
//程序信息结束---------------------------------------

//初始化数
  IniTree(ctree);

//主操作界面区---------------------------------------
  ShowMainInterface();
  
  ch=getch();
  while(ch!='q')
  {
    while((ch!='a')&&(ch!='b')&&(ch!='c')&&(ch!='d')&&(ch!='e'))
    {
       printf("choose a or b or c or d or e or q!\n");
       ch=getch();
       if(ch=='q')
     break;
    }
       
    
    switch(ch)
    {
      case 'a':
         if(ctree->root==NULL)
            printf("-----------There is no information.------------\n");
     else
     {printf("---------My Address List is followed:---------\n");
      ShowTree(ctree->root);
      printf("------------------My Address List end-------------------\n");
         }
         printf("Total number is %d.\n",ctree->numbers);
         ShowMainInterface();
         printf("please choose:\n");
         ch=getch();  
         printf("your choose is:%c\n",ch);     
     break;
      case 'b':ChoiceAdd(ctree);ShowMainInterface();
         printf("please choose:\n");
         ch=getch();
         printf("your choose is:%c\n",ch);        
     break;
      case 'c':Choicemod(ctree);ShowMainInterface();
         printf("please choose:\n");
         ch=getch(); 
         printf("your choose is:%c\n",ch);       
     break;
      case 'd':ChoiceDel(ctree);ShowMainInterface();
         printf("please choose:\n");
         ch=getch();
         printf("your choose is:%c\n",ch);        
     break;
      case 'e':Choicefind(ctree);ShowMainInterface();
         printf("please choose:\n");
         ch=getch();
         printf("your choose is:%c\n",ch); 
     break; 
      case 'q':
         printf("your choose is:q\n"); 
     break;
     }
  }
  
  TreeWrite(ctree->root);
  printf("GoodBye!\ninput any key to quit.");
     
//主操作界面结束-------------------------------------

  getch();
  return 0;
} 

 

 

 

Android简单通讯录的开发 本次开发分为4步: 1、获取手机通讯录的信息; 2、手机通讯录的数据封装; 3、手机通讯录的信息的UI适配; 4、对ListView的优化。 GetNumber.java: 用来获取手机通讯录。下面是代码部分: package com.example.getmyphonenumber; import java.util.ArrayList; import java.u 阅读详情

相关推荐

iPhone通讯录批量整理方法

公司内部有员工小号,原本的编排规则发生了变动, 导致很多的来点无法识别归属。今天闲来无事,整理了一下自己的通讯录,想的应该挺简单,但实际操作起来,却遇到了不少麻烦。 整体思路: 1.导出现有通讯录 2.新员工小号进行匹配 3.更新手机通讯录 设备环境: iPhone + iOS 13.0 + Windows 操作步骤: ...

weapon14的博客 1万+

手机通讯录系统

手机通讯录系统1、设计目的与要求1.1题目与设计要求 我们设计的程序为手机通讯录系统,这是使用C语言写成。本程序具有和一般的通讯录一样的功能,有最基本的数据添加、修改、查看、删除等功能。通过对程序的设计的目的是为了提高我们对C语言的整体把握与应用。能把学会的知识真正的会应用。 1.2 本程序涉及的知识点 If语句 switch语句 for循坏 do…while循坏 goto语句

曹世宏的博客 1万+

android 获取手机通讯录联系人,模拟通讯录显示

主要是获取手机通讯录,模拟手机通讯录的搜索、字母排序显示;

u011622479的博客 8712

通讯录的实现

实现一个通讯录; 通讯录可以用来存储1000个人的信息,每个人的信息包括:姓名、性别、年龄、电话、住址 提供方法: 添加联系人信息 删除指定联系人信息 查找指定联系人信息 修改指定联系人信息 显示所有联系人信息 清空所有联系人 以名字排序所有联系人 下面是头文件部分 #define _CRT_SECURE_NO_WARNINGS #define MAN_NAME 15 //定义名字数组中字符元素个数 #define MAN_SEX 5 //定义性别数组中字符元素个数

yahid的博客 550

个人通讯录系统uml图

uml图ER图,数据流程图等课程设计必备图

个人通讯录系统全套设计(代码+课程设计文档+uml图)

这是老师要求做的课程设计用的是sql2005和vs2008开发的简单的系统设计,包括完整的可运行的代码和完整的课程设计文档,还有完整的uml图哟。

二十二、通讯录实现

通讯录基本功能//通讯录结构设计//通讯录具体功能及代码实现//初始化通讯录函数//增加联系人函数//显示所有联系人信息函数//查找指定联系人函数//删除联系人函数//修改指定联系人函数//通讯录的结构优化//初始化通讯录函数的优化//增加联系人函数的优化//释放通讯录空间函数

HackerKevon的博客 2090

通讯录列表

android实现ListView的根据A-Z排序和搜索过滤跟能

【C语言】——通讯录动态文件保存版本(保姆级教程)

本文介绍用C语言知识模拟实现一个通讯录,用来储存联系人的信息。这其中会应用到数据结构中的顺序表来实现。其中每个联系人的信息包括:姓名,年龄,性别,电话,住址。

weixin_73807021的博客 1483

通讯录程序UML模型

通讯录程序UML模型,整理自国外一个网站。

【实战解析】Ubuntu双网卡冲突:如何解决同一网段下网关无法访问及上网问题

本文深入解析Ubuntu服务器双网卡配置在同一网段时引发的路由冲突问题,导致网关无法ping通及无法上网。通过分析路由表与Metric值原理,提供使用route命令调整优先级及修改Netplan配置文件的实战解决方案,确保主次路由明确,一劳永逸解决网络冲突。

f9g0h的博客 280

【C语言】通讯录

在通讯录中,我们一般保存联系人的信息,联系人的信息一般会有 姓名、年龄、性别、电话、地址等。在通讯录中,我们也会对一些信息进行增删改查。在这里我们发现switch 语句中 的case 选项中的常量表达式 是字母,这里主要是利用了枚举常量。这里采用的思想是 数组后面的元素前移将前面的元素覆盖来达到删除该信息的目的。上述是增加联系人的信息,既然增加联系人我们就来查看联系人信息。功能实现的前提是 先对通讯录 进行设计 并 初始化。contact.c 用于主要代码的功能实现。这里是直接调用的初始化通讯录函数。

加油!!! 2992

强化学习_06_pytorch-TD3实践(BipedalWalkerHardcore-v3)

DDPG的critic会高估, 从而导致actor策略失败。TD3是增加了三个关键技巧优化DDPG。经过优化后的TD3(Twin Dalayed DDPG 双延迟深度确定性策略梯度算法)适合于具有高维连续动作空间的任务。

RL小站 2689

C语言实现通讯录

C语言实现通讯录功能

Lehjy的博客 2304

android HTTPS未校验服务器证书漏洞修复

上述代码是重写了域名校验的逻辑,每个证书里携带的域名是不可更改的,如果证书是合法的证书签发机构签发的,并且域名是和你要请求的域名对的上的,基本上就能确认你访问就服务器地址就是要访问的服务器地址,这样才是安全的。上述代码就是重新了证书校验的逻辑,信任所有的证书,正确的逻辑是要校验证书是否是可信任的证书签发机构所认证的,如果不校验的话你虽然是用了https加密传输,只要你的客户端用户信任了其他的证书哪怕是非法的证书,一样能够请求通过,而这个证书的服务器就可以解密你的报文,拿到你的隐私信息了。

kyzycyey的专栏 2622

手把手教你用QEMU虚拟化华为路由器固件(附完整网络配置指南)

本文提供了一份详尽的QEMU虚拟化华为路由器固件的实战指南。从固件解包、网络桥接配置到QEMU虚拟机启动,手把手教你搭建完整的嵌入式设备沙箱环境,特别适合安全研究、逆向分析和学习嵌入式系统工作原理。

tgb3456789的博客 937

【C语言】通讯录的实现

通讯录——不断优化之路

m0_73737103的博客 2901

Jetson Nano 实战指南:深度学习环境配置与 YOLOv5 边缘端部署解析

Jetson Nano是NVIDIA推出的嵌入式AI开发板,凭借其强大的GPU计算能力和完善的软件生态系统,成为边缘AI部署的理想平台。本教程源于作者团队参加2024中国机器人大赛暨RoboCup机器人世界杯中国赛机器人先进视觉3D识别赛道的实战经验,是一份经过验证的环境部署指南。

FJN110的博客 152

iOS获取通讯录的方法

iOS中通讯录的用法。CNContactStore类是iOS中的一个框架,用于访问和管理设备上的通讯录数据。它提供了一种统一的方式来获取、添加、更新和删除联系人和群组,以及监听通讯录数据的变化。在iOS开发中,CNContactStore类具有重要性,因为它允许应用程序与设备上的通讯录进行交互,从而实现诸如获取联系人信息、同步联系人数据、发送通讯录相关的通知等功能。通过CNContactStore类,开发人员可以轻松地构建与通讯录相关的功能,提高应用程序的用户体验和功能性。

我叫柱子哥 4650

使用MATLAB和Simulink来设计并仿真一个智能家居多传感器数据融合系统

智能家居多传感器数据融合系统旨在通过集成来自多种不同类型的传感器的数据,以提供更精确和可靠的环境信息或用户状态监测。例如,将温度、湿度、光照强度、运动检测等多种传感器的数据结合起来,可以更好地了解家庭内部的状态,并做出相应的调整或响应。在这个教程中,我们将使用MATLAB和Simulink来设计并仿真一个智能家居多传感器数据融合系统。

amy_mhd的博客 187

SAP NetWeaver Business Client (NWBC) 的深入解析

SAP NetWeaver Business Client(NWBC)作为 SAP 提供的一种用户界面,旨在为终端用户提供无缝集成传统 SAP GUI 事务和新开发的基于 Web Dynpro ABAP 的应用程序的体验。SAP NetWeaver Business Client(NWBC)是 SAP 推出的用户界面,旨在为终端用户提供单一入口,集成传统的 SAP GUI 事务和新开发的基于 Web Dynpro ABAP 的应用程序。在实际业务场景中,NWBC 的应用提升了用户的工作效率和体验。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 1603

基于顺序表实现通讯录

我们之前实现顺序表的时候,顺序表储存的是整型类型的数据。我们要想实现通讯录的话,那么存储的类型应该是储存自定义类型的数据。这个自定义类型的数据应该是结构体。先在通讯录的头文件在定义通讯录的结构201020100int age;}peoInfo;因为通讯录的实现是基于顺序表的,要将顺序表中存放的数组类型改为结构体类型,也就是我们定义的通讯录结构体。int size;}SL;注意不要忘了头文件。下面就要在通讯录头文件中声明函数了,想一下。

GGDxianv的博客 1523

第16课:动手实战中文句法依存分析

句法分析是自然语言处理(NLP)中的关键技术之一,其基本任务是确定句子的句法结构或者句子中词汇之间的依存关系。主要包括两方面的内容:一是确定语言的语法体系,即对语言中合法句子的语法结构给予形式化的定义;另一方面是句法分析技术,即根据给定的语法体系,自动推导出句子的句法结构,分析句子所包含的句法单位和这些句法单位之间的关系。 句法分析被用在很多场景中,比如搜索引擎用户日志分析和关键词识别,比如信息抽...

春华秋实 2435

维护通讯录的方法及群组通讯录 管理平台

本发明公开了一种维护通讯录的方法及平台,属于通讯录技术领域。方法包括 :建立一个或多个群组通讯录,并为所建立的群组通讯录分配群组 ID ;当接收到用户端发送的下载更新用户端通讯录的请求时,根据所建立的群组通讯录对所述用户端通讯录进行更新

wangwl_89的博客 2345

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

我们天天在使用的通讯录原来是这样实现的呀——C语言实现简单静态通讯录和动态通讯录(基于顺序表)

⭐️前面的话⭐️ 大家好!在生活中大家一定离不开通讯录或类似功能的联系人列表,比如QQ好友列表,微信朋友列表。在这篇文章中我会详细介绍如何使用C语言来搭建一个简单的通讯录,包括静态通讯录和动态通讯录。

未见花闻的博客 1431

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

通讯录——文件版

通讯录——文件版(详细实现)

czh1592272237的博客 1976

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

上一篇: 字符库函数
下一篇: Mystrncpy
王翔乐
博客等级 码龄8年 6粉丝 45原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值