LZW编码

2023-11-20

    LZW(Lempel-Ziv & Welch)编码又称字串表编码,是Welch将Lemple和Ziv所提出来的无损压缩技术改进后的压缩方法。GIF图像文件采用的是一种改良的LZW压缩算法,通常称为GIF-LZW压缩算法。下面简要介绍GIF-LZW的编码与解码方法。

例 现有来源于二色系统的图像数据源(假设数据以字符串表示):aabbbaabb,试对其进行LZW编码及解码。

解:1)根据图像中使用的颜色数初始化一个字串表(如表1),字串表中的每个颜色对应一个索引。在初始字串表的LZW_CLEAR和LZW_EOI分别为字串表初始化标志和编码结束标志。设置字符串变量S1、S2并初始化为空。

    2)输出LZW_CLEAR在字串表中的索引3H(见表2第一行)。

    3)从图像数据流中第一个字符开始,读取一个字符a,将其赋给字符串变量S2。判断S1+S2=“a”在字符表中,则S1=S1+S2=“a”(见表2第二行)。

    4)读取图像数据流中下一个字符啊,将其赋给字符串变量S2。判断S1+S2=“aa”不在字符串表中,输出S1=“a”在字串表中的索引0H,并在字串表末尾为S1+S2="aa"添加索引4H,且S1=S2=“a”(见表2第三行)。

    5)读下一个字符b赋给S2。判断S1+S2=“ab”不在字符串表中,输出S1=“a”在字串表中的索引0H,并在字串表末尾为S1+S2=“ab”添加索引5H,且S1=S2=“b”(见表2第四行)。

    6)读下一个字符b赋给S2。S1+S2=“bb”不在字串表中,输出S1=“b”在字串表中的索引1H,并在字串表末尾为S1+S2=“bb”添加索引6H,且S1=S2=“b”(见表2第五行)。

    7)读字符b赋给S2。S1+S2=“bb”在字串表中,则S1=S1+S2=“bb”(见表2第六行)。

    8)读字符a赋给S2。S1+S2=“bba”不在字串表中,输出S1=“bb”在字串表中的索引6H,并在字串表末尾为S1+S2=“bba”添加索引7H,且S1=S2=“a”(见表2第七行)。

    9)读字符a赋给S2。S1+S2=“aa”在字串表中,则S1=S1+S2=“aa”(见表2第八行)。

    10)读字符b赋给S2。S1+S2=“aab”不在字串表中,输出S1=“aa”在字串表中的索引4H,并在字串表末尾为S1+S2=“aab”添加索引8H,且S1=S2=“b”(见表2第九行)。

    11)读字符b赋给S2。S1+S2=“bb”,在字串表中,则S1=S1+S2=“b”(见表2第十行)。

    12)输出S1中的字符串"b"在字串表中的索引1H(见表2第十一行)。

    13)输出结束标志LZW_EOI的索引3H,编码完毕。

    最后的编码结果为"30016463“。


 

 

下面对上述编码结果"30016463"进行解码。同样先初始化字符串表,结果如表1所示。

    1)首先读取第一个编码Code=3H,由于它为LZW_CLEAR,无输出(见表3第一行)。

    2)读入下一个编码Code=0H,由于字符串表中存在该索引,因此输出字符串表中0H对应的字符串"a",同时使OldCode=Code=0H(见表3第二行)。

    3)读下一个编码Code=0H,字符串表中存在该索引,输出0H所对应的字符串"a",然后将OldCode=0H所对应的字符串"a"加上Code=0H所对应的字符串的第一个字符"a",即"aa"添加到字串表中,其索引为4H,同时使OldCode=Code=0H(见表3第三行)。

    4)读下一个编码Code=1H,字串表中存在该索引,输出1H所对应的字符串"b",然后将OldCode=0H所对应的字符串"a"加上Code=1H所对应的字符串的第一个字符"b",即"ab"添加到字串表中,其索引为5H,同时使OldCode=Code=1H(见表3第四行)。

    5)读入下一个编码Code=6H,由于字串表中不存在该索引,因此输出OldCode=1H所对应的字符串"b"加上OldCode的第一个字符"b“,即"bb",同时将"bb"添加到字符串表中,其索引为6H,同时使OldCode=Code=6H(见表3第五行)。

    6)读下一个编码Code=4H,字串表中存在该索引,输出4H所对应的字符串"aa",然后将OldCode=6H所对应的字符串"bb"加上Code=4H所对应的字符串的第一个字符"a",即"bba"添加到字串表中,其索引为7H,同时使OldCode=Code=4H(见表3第六行)。

    7)读下一个编码Code=6H,字串表中存在该索引,输出6H所对应的字符串"bb",然后将OldCode=4H所对应的字符串"aa"加上Code=6H所对应的字符串的第一个字符"b",即"aab"添加到字串表中,其索引为8H,同时使OldCode=Code=6H(见表3第七行)。

    8)读下一个编码Code=3H,它等于LZW_EOI,数据解码完毕(见表3第八行)。

最后的解码结果为aabbbaabb。

 

由此可见,LZW编码算法在编码与解码过程中所建立的字符串表是一样的,都是动态生成的,因此在压缩文件中不必保存字符串表。

 

/***********************************************************************************************************
 LZW.c

本演示程序提供了LZW编码法的压缩和解压缩函数,并实现了对图象
文件的压缩和解压缩
**********************************************************************************************************/

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

#define BITS 12                   /* Setting the number of bits to 12, 13*/
#define HASHING_SHIFT BITS-8      /* or 14 affects several constants.    */
#define MAX_VALUE (1 << BITS) - 1 /* Note that MS-DOS machines need to   */
#define MAX_CODE MAX_VALUE - 1    /* compile their code in large model if*/
                                  /* 14 bits are selected.               */
#if BITS == 14
  #define TABLE_SIZE 18041        /* The string table size needs to be a */
#endif                            /* prime number that is somewhat larger*/
#if BITS == 13                    /* than 2**BITS.                       */
  #define TABLE_SIZE 9029
#endif
#if BITS <= 12
  #define TABLE_SIZE 5021
#endif

/* 函数原型 */
int LZW_Compression(char *in_filename, char *out_filename);
int LZW_Decompression(char *in_filename, char *out_filename);

/* 内部函数 */
int find_match(int hash_prefix,unsigned int hash_character);
char *decode_string(unsigned char *buffer,unsigned int code);
unsigned int input_code(FILE *input);
void output_code(FILE *output,unsigned int code);

/* 全局变量,编码/解码使用的内存缓冲区 */
int *code_value;                  /* This is the code value array        */
unsigned int *prefix_code;        /* This array holds the prefix codes   */
unsigned char *append_character;  /* This array holds the appended chars */
unsigned char decode_stack[4000]; /* This array holds the decoded string */


/* 主程序 */
void main(int argc, char *argv[])
{
 printf("LZW compression and decompression utility/n");

 if (4 != argc)
 {
  printf("/nUsage : lzw -c|d sourcefilename targetfilename/n");
  exit(0);
 }

 if (! strcmp(argv[1], "-c"))
  LZW_Compression(argv[2], argv[3]);
 else if (! strcmp(argv[1], "-d"))
  LZW_Decompression(argv[2], argv[3]);
 else
  printf("/nUnknow command./n");
}

/**************************************************************************************************
 LZW_Compression()

  本函数用LZW算法压缩指定的文件,并将结构存储到新的文件中                                    
***************************************************************************************************/
int LZW_Compression(char *in_filename, char *out_filename)
{
  unsigned int next_code;
  unsigned int character;
  unsigned int string_code;
  unsigned int index;
  int i;
  FILE *input;
  FILE *output;

  /* allocate memory for compression */
  code_value=malloc(TABLE_SIZE*sizeof(unsigned int));
  prefix_code=malloc(TABLE_SIZE*sizeof(unsigned int));
  append_character=malloc(TABLE_SIZE*sizeof(unsigned char));
  if (code_value==NULL || prefix_code==NULL || append_character==NULL)
  {
    printf("Fatal error allocating table space!/n");
    return 0;
  }

  /* open files */
  input=fopen(in_filename,"rb");
  output=fopen(out_filename,"wb");
  if (input==NULL || output==NULL)
  {
    printf("Fatal error opening files./n");
    return 0;
  };

  /* compressing... */

  next_code=256;              /* Next code is the next available string code*/
  for (i=0;i<TABLE_SIZE;i++)  /* Clear out the string table before starting */
    code_value[i]=-1;

  i=0;
  printf("Compressing.../n");
  string_code=getc(input);    /* Get the first code                         */
/*
** This is the main loop where it all happens.  This loop runs util all of
** the input has been exhausted.  Note that it stops adding codes to the
** table after all of the possible codes have been defined.
*/
  while ((character=getc(input)) != (unsigned)EOF)
  {
    if (++i==1000)                         /* Print a * every 1000    */
    {                                      /* input characters.  This */
      i=0;                                 /* is just a pacifier.     */
      printf(".");
    }
    index=find_match(string_code,character);/* See if the string is in */
    if (code_value[index] != -1)            /* the table.  If it is,   */
      string_code=code_value[index];        /* get the code value.  If */
    else                                    /* the string is not in the*/
    {                                       /* table, try to add it.   */
      if (next_code <= MAX_CODE)
      {
        code_value[index]=next_code++;
        prefix_code[index]=string_code;
        append_character[index]=character;
      }
      output_code(output,string_code);  /* When a string is found  */
      string_code=character;            /* that is not in the table*/
    }                                   /* I output the last string*/
  }                                     /* after adding the new one*/
/*
** End of the main loop.
*/
  output_code(output,string_code); /* Output the last code               */
  output_code(output,MAX_VALUE);   /* Output the end of buffer code      */
  output_code(output,0);           /* This code flushes the output buffer*/
  printf("/n");

  /* cleanup... */
  fclose(input);
  fclose(output);

  free(code_value);
  free(prefix_code);
  free(append_character);

  return 1;
}

/*
** This is the hashing routine.  It tries to find a match for the prefix+char
** string in the string table.  If it finds it, the index is returned.  If
** the string is not found, the first available index in the string table is
** returned instead.
*/

int find_match(int hash_prefix,unsigned int hash_character)
{
int index;
int offset;

  index = (hash_character << HASHING_SHIFT) ^ hash_prefix;
  if (index == 0)
    offset = 1;
  else
    offset = TABLE_SIZE - index;
  while (1)
  {
    if (code_value[index] == -1)
      return(index);
    if ((int)prefix_code[index] == hash_prefix &&
        append_character[index] == hash_character)
      return(index);
    index -= offset;
    if (index < 0)
      index += TABLE_SIZE;
  }
}

/*******************************************************************
 LZW_Decompression()

  用LZW对文件进行解码                                    
********************************************************************/
int LZW_Decompression(char *in_filename, char *out_filename)
{
  unsigned int next_code;
  unsigned int new_code;
  unsigned int old_code;
  int character;
  int counter;
  unsigned char *string;
  FILE *input;
  FILE *output;

  /* allocate memory for decompression */
  prefix_code=malloc(TABLE_SIZE*sizeof(unsigned int));
  append_character=malloc(TABLE_SIZE*sizeof(unsigned char));
  if (prefix_code==NULL || append_character==NULL)
  {
    printf("Fatal error allocating table space!/n");
    return 0;
  }

  /* open files */
  input=fopen(in_filename,"rb");
  output=fopen(out_filename,"wb");
  if (input==NULL || output==NULL)
  {
    printf("Fatal error opening files./n");
    return 0;
  };

  /* decompress... */

  next_code=256;           /* This is the next available code to define */
  counter=0;               /* Counter is used as a pacifier.            */
  printf("Decompress.../n");

  old_code=input_code(input);  /* Read in the first code, initialize the */
  character=old_code;          /* character variable, and send the first */
  putc(old_code,output);       /* code to the output file                */
/*
**  This is the main expansion loop.  It reads in characters from the LZW file
**  until it sees the special code used to inidicate the end of the data.
*/
  while ((new_code=input_code(input)) != (MAX_VALUE))
  {
    if (++counter==1000)   /* This section of code prints out     */
    {                      /* an asterisk every 1000 characters   */
      counter=0;           /* It is just a pacifier.              */
      printf(".");
    }
/*
** This code checks for the special STRING+CHARACTER+STRING+CHARACTER+STRING
** case which generates an undefined code.  It handles it by decoding
** the last code, and adding a single character to the end of the decode string.
*/
    if (new_code>=next_code)
    {
      *decode_stack=character;
      string=decode_string(decode_stack+1,old_code);
    }
/*
** Otherwise we do a straight decode of the new code.
*/
    else
      string=decode_string(decode_stack,new_code);
/*
** Now we output the decoded string in reverse order.
*/
    character=*string;
    while (string >= decode_stack)
      putc(*string--,output);
/*
** Finally, if possible, add a new code to the string table.
*/
    if (next_code <= MAX_CODE)
    {
      prefix_code[next_code]=old_code;
      append_character[next_code]=character;
      next_code++;
    }
    old_code=new_code;
  }
  printf("/n");

  /* cleanup... */
  fclose(input);
  fclose(output);

  free(prefix_code);
  free(append_character);

  return 1;
}

/*
** This routine simply decodes a string from the string table, storing
** it in a buffer.  The buffer can then be output in reverse order by
** the expansion program.
*/

char *decode_string(unsigned char *buffer,unsigned int code)
{
int i;

  i=0;
  while (code > 255)
  {
    *buffer++ = append_character[code];
    code=prefix_code[code];
    if (i++>=4094)
    {
      printf("Fatal error during code expansion./n");
      exit(0);
    }
  }
  *buffer=code;
  return(buffer);
}

/*
** The following two routines are used to output variable length
** codes.  They are written strictly for clarity, and are not
** particularyl efficient.
*/

unsigned int input_code(FILE *input)
{
unsigned int return_value;
static int input_bit_count=0;
static unsigned long input_bit_buffer=0L;

  while (input_bit_count <= 24)
  {
    input_bit_buffer |=
        (unsigned long) getc(input) << (24-input_bit_count);
    input_bit_count += 8;
  }
  return_value=input_bit_buffer >> (32-BITS);
  input_bit_buffer <<= BITS;
  input_bit_count -= BITS;
  return(return_value);
}

void output_code(FILE *output,unsigned int code)
{
static int output_bit_count=0;
static unsigned long output_bit_buffer=0L;

  output_bit_buffer |= (unsigned long) code << (32-BITS-output_bit_count);
  output_bit_count += BITS;
  while (output_bit_count >= 8)
  {
    putc(output_bit_buffer >> 24,output);
    output_bit_buffer <<= 8;
    output_bit_count -= 8;
  }
}

 

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

LZW编码 的相关文章

  • 对于MySQL查询中的每个结果,推送到数组(复杂)

    好吧 这就是我想做的 我正在运行 MySQL 查询来获取最新的帖子 对于每个返回的行 我需要将行的 ID 推送到数组 然后在数组的该 ID 内 我需要从行中添加更多数据 多维数组 到目前为止 这是我的代码 query SELECT FROM
  • Python - 如何在 Python 中剪切字符串?

    假设我有以下字符串 http www domain com s some two 20 怎样才能脱掉之后的东西 包括 并有这个字符串 http www domain com s some 好吧 回答眼前的问题 gt gt gt s http
  • 当 edmx 文件位于单独的项目中时出错

    我有问题说 在配置中找不到指定的命名连接 或者不打算与EntityClient提供者 或无效 我的 edmx 文件位于单独的项目中 但该项目的连接字符串app config 什么可能导致问题 确保 app config 位于设置为启动项目的
  • PHP 如何使用比较运算符比较字符串?

    我正在使用比较运算符来比较字符串 我需要对以下两个比较及其结果进行某种解释 if ai gt i echo Yes else echo No output No 为什么这些会这样输出 if ia gt i echo Yes else ech
  • 未终止的字符串文字

    我有一个 php 脚本 可以在我的服务器上上传 mp3 文件 我使用 上传 有一个事件 onSelect 文档 http www uploadify com documentation events onselect 当文件上传时调用 使用
  • 使用 JavaScript 替换字符串的最后一个字符

    我有一个很小的疑问 我尝试使用 concat charAt slice 等 但我不知道该怎么做 这是我的字符串 var str1 Notion Data Identity 我想更换最后一个 with a 它应该看起来像这样 var str1
  • 从字符串中获取大写字母的索引[重复]

    这个问题在这里已经有答案了 可能的重复 指定 CamelCase 字符串的算法 https stackoverflow com questions 484085 an algorithm to spacify camelcased stri
  • 为什么《破解编码面试》这个例子的时间复杂度是O(k c^k)?

    该问题来自 破解编码面试 第 6 版 问题 V1 11 以下代码打印长度为 k 的所有字符串 其中字符 是按排序顺序排列的 它通过生成所有长度的字符串来做到这一点 k 然后检查每个是否已排序 什么是运行时间 package QVI 11 P
  • 尝试将字符串数组中的第一个字符大写,为什么这不起作用?

    我正在尝试编写一个转换的函数 例如list style image to listStyleImage 我想出了一个功能 但它似乎不起作用 有人能指出我这里的问题吗 var myStr list style image function c
  • 是否有与 f 字符串语法等效的可调用函数?

    每个人都喜欢 Python 3 6 的新 f 字符串 In 33 foo blah bang In 34 bar blah In 35 f foo bar Out 35 bang 然而 虽然在功能上非常相似 但它们的语义并不完全相同str
  • std::string substr 方法问题

    你好 我正在写这个方法 我希望它从给定缓冲区中提取给定位置的一部分 我有一个像这样的字符串something one something two我想要得到 一个 这是我的想法 static std string Utils getHeade
  • 如何将字符串转换为二进制?

    我需要一种方法来获取 python 中字符串的二进制表示形式 例如 st hello world toBinary st 是否有一个模块可以以某种巧妙的方式执行此操作 像这样的东西吗 gt gt gt st hello world gt g
  • 用 ruby​​ 中的数组内容替换字符串?

    String Test string Test array link1 link2 如何替换这样的字符串 输出应该是String link1 string link2 字符串 gsub 可以返回一个枚举器 所以这很简单 string gsu
  • 如何使Python格式的浮点数具有一定数量的有效数字?

    我希望我的 Python 2 4 3 输出数字具有特定的格式 具体来说 如果数字是有效数字 6 位有效数字 则仅输出 6 位有效数字 A 显示了 Python 如何编写浮点数 B 显示了我希望它们如何书写 我怎样才能让Python以这种方式
  • 如何在 Javascript 中附加或连接字符串?

    所以我试图添加到一个字符串 但它显示为空 var DNA TAG var mRNA m RNA function check a b string if string a mRNA concat b function m RNA conso
  • 减少非常大图像的文件大小,而不改变图像尺寸

    考虑一个处理可能非常大的 PNG 文件上传的应用程序 所有上传的文件必须存储到磁盘以供以后检索 但是 PNG 文件的大小最大可达 30 MB 但磁盘存储限制规定每个文件的最大大小为 1 MB 问题是获取文件大小高达 30 MB 的输入 PN
  • 查找文本文件中的唯一单词

    我正在用 Java 编写这个程序来查找文本文件中的唯一单词 我想知道这段代码是否正确 因为它甚至将空格显示为单词 String words List
  • 获取ERLANG中的最长公共子序列

    我是这个 ERLANG 的新手 我了解基础知识 这就像计划 但范围更广 我知道如何创建一个函数 但在创建一个获取最长公共子序列的函数时遇到问题 lcs str1 str2 是一个接受两个字符串并输出一个整数的函数 lcs algorithm
  • Golang中如何删除字符串的最后一个字符?

    我想删除字符串的最后一个字符 但在此之前我想检查最后一个字符是否是 如何才能做到这一点 以下是删除尾随加号的几种方法 package main import fmt strings func TrimSuffix s suffix stri
  • C++:初始化静态字符串成员

    我在 C 中初始化静态字符串成员时遇到一些问题 我有几个类 每个类都包含几个表示 id 的静态字符串成员 当我通过调用静态函数初始化变量时 一切都很好 但是 当我想为一个变量分配另一个变量的值时 它仍然保留空字符串 这段代码有什么问题 st

随机推荐

  • vue安装Base64转码

    第一步 项目文件路径下运行 npm install save js base64 或者 cnpm install save js base64 第二步 main js文件中引入 const Base64 require js base64
  • vue——vue-video-player插件实现rtmp直播流

    更新 flash已不可再使用 大家另寻出路吧 安装前首先需要注意几个点 vue video player插件 其实就是 video js 集成到 vue 中 所以千万不要再安装 video js 可能会出错 视频流我这个项目选择rtmp格式
  • 3559摄像头

    input aoni Webcam as devices platform soc 12310000 xhci 1 usb1 1 1 1 1 1 0 input input0 yuv转 的代码 https github com 198708
  • DC/DC闭环控制的丘克(Cuk)变换电路原理设计及实验仿真

    如果将降压 Buck 变换电路和升压 Boost 变换电路的拓扑结构进行对偶变换 即Boost变换电路和Buck变换电路串联在一起得到一种新的电路拓扑结构 丘克 CUK 变换电路 如图所示 Cuk变换电路的输入和输出均有电感 增加电感的值
  • matlab画圆并生成随机数

    A区域生成随机数 画圆 t 0 pi 100 2 pi x 10 cos t 30 3 y 10 sin t 89 8 plot x y r 生成随机数 a zeros 2 8 i 1 while i lt 8 temp1 rand 1 2
  • node中间件是什么意思?

    node中间件是什么意思 2020 09 11 16 11 17分类 常见问题 Node js答疑阅读 1757 评论 0 中间件是一种独立的系统软件或服务程序 分布式应用软件借助这种软件在不同的技术之间共享资源 中间件位于客户机 服务器的
  • Spark SQL 项目:实现各区域热门商品前N统计

    一 需求1 1 需求简介这里的热门商品是从点击量的维度来看的 计算各个区域前三大热门商品 并备注上每个商品在主要城市中的分布比例 超过两个城市用其他显示 1 2 思路分析使用 sql 来完成 碰到复杂的需求 可以使用 udf 或 udaf查
  • 四位均衡磨损格雷码

    什么是均衡磨损格雷码 均衡磨损格雷码是一种与标准格雷码具有相同的迭代后只变化一个位的特性 但每一个数位变化的次数相近的编码 为什么要均衡磨损 由于继电器输出PLC比晶体管输出PLC具有更好的可靠性 如果用继电器输出的PLC代替晶体管输出PL
  • 从0开始用shell写一个tomcat日志清理脚本

    一 目的 tomcat日志随着时间的流逝会越来越大 虽然我们可以使用cronolog对tomcat输出的日志根据日期进行切割 但是日子一长 进到logs 文件夹下都是密密麻麻的日志 不好查看也浪费了大量的空间 故本文的目的是编写一个脚本 能
  • linux 0.11 int80实现,Linux0.11内核--系统中断处理程序int 0x80实现原理

    extern int sys setup 系统启动初始化设置函数 kernel blk drv hd c 71 extern int sys exit 程序退出 kernel exit c 137 extern int sys fork 创
  • 神经网络学习小记录68——Tensorflow2版 Vision Transformer(VIT)模型的复现详解

    神经网络学习小记录68 Tensorflow2版 Vision Transformer VIT 模型的复现详解 学习前言 什么是Vision Transformer VIT 代码下载 Vision Transforme的实现思路 一 整体结
  • 尘技-教你如何造安全相关文章

    介绍 写文章不仅仅能够总结自己的知识 还能为他人提供帮助 以及 我为自己代言 稿费 曝光度等等 如何能有思路的制造文章 下面由我慢慢道来 造文种类 造文可以分为总结类 创新类 实录类 见解类 工具分享类等等 每种类型的文章 都有自己的造文套
  • JDK自带JVM监控jvisualvm.exe 观察JVM内应用程序

    无论在测试环境还是在生产环境 我们都想知道程序在JVM中是否正常运行 除了使用第三方的一些工具 最直接的就是使用JDK自带的jvisualvm exe 系统主界面操作 JVM提供了本地的JVM监控 远程的JMX监控和快照服务 VM示例 Vi
  • 本地CPU部署运行ChatGLM2-6B模型

    1 前期准备 需要下载模型文件 2 部署过程及碰到的问题 1 编译安装python 3 8 13 Asianux release 7 6 18 gcc 4 8 5 按运行的要求需要安装torch的 gt 2 0 因此安装了torch的2 0
  • 网站打不开如何解决?教你4个方法搞定它!

    网站打不开如何解决 教你4个方法搞定它 网站如果打不开了 会影响正常的使用 并且对于SEO关键词排名还是有影响的 那么网站打不开如何解决 可能对于不懂技术的客户来说这是个着急的问题 突然发现自己的网站打不开了 不知所措 如果再遇到这样的问题
  • 记录一次elasticsearch挂掉之后无法启动 kibana Status: Red -分析过程

    记录一次elasticsearch挂掉之后无法启动 kibana Status Red 分析过程 现象 现象一 kibana Status Red 现象二 elasticsearch 集群挂掉 现象三 elasticsearch 重启 检查
  • 群晖DSM7.2 系统Web Station配置NodeJS类型网站访问方法

    平时也不怎么更新系统 最近因为用SH方式架设运行的NodeJS网站Express用着有点小问题 其中细节还需要测试原因 在更新了一堆套件之后 又看到了 系统更新的小细点 一时手残便点了更新 然后就来到了DSM 7 2 64570 Updat
  • 2014年1月30日-2月6日,(共4小时,剩4682小时)

    过年期间 初五学了3小时 初七晚上1小时 共4小时 受打击很大 好好努力吧
  • 常用表单正则表达式

    校验 大小写字母 汉字 export const verifyCheEng a zA Z p sc Han gu 校验 数字 大小写字母 汉字 export const verifyCheEngNum a zA Z0 9 p sc Han
  • LZW编码

    LZW Lempel Ziv Welch 编码又称字串表编码 是Welch将Lemple和Ziv所提出来的无损压缩技术改进后的压缩方法 GIF图像文件采用的是一种改良的LZW压缩算法 通常称为GIF LZW压缩算法 下面简要介绍GIF LZ