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编码 的相关文章

  • 在 Ruby 中,如何生成一长串重复文本?

    在 ruby 中快速生成长字符串的最佳方法是什么 这有效 但速度非常慢 str length 100000 1 length each i str 0 我还注意到 创建一个适当长度的字符串 然后将其附加到现有字符串直至所需的长度 速度会更快
  • 如何根据数字/非数字分割字符串(使用正则表达式?)

    我想在 python 中将一个字符串拆分为一个列表 具体取决于数字 而不是数字 例如 5 55 6 5 应该返回 5 55 6 5 我目前有一些代码循环遍历字符串中的字符并使用 re match d 或 D 测试它们 我想知道是否有更好的方
  • pandas - 将字符串转换为字符串列表[重复]

    这个问题在这里已经有答案了 我有这个 file csv 文件可以用 pandas 读取 Title Tags T1 Tag1 Tag2 T1 Tag1 Tag2 Tag3 T2 Tag3 Tag1 using df pd read csv
  • 如何将大型 XML 字符串插入 Oracle 表中?

    我想将一个大的 XML 字符串插入到我的表中 我的表是 test id xml column XMLType 当我插入值时 它返回 字符串文字太长 错误 我上网查了一下 大家都说把数据类型改成CLOB 但我想存储相同的数据类型 XMLTyp
  • richTextBox 字符数限制?

    我在丰富的文本框中存储大量文本时遇到问题 我正在尝试读取一个相当大的文本文件 从 90mb 到 450mb 的任意位置 并将我读到的内容放入富文本框中 它可以在一个简单的程序中运行 但是当我在一个复杂的程序中运行时 我会得到一个 OutOf
  • 在 C 中打印字符串的所有排列

    我正在学习回溯和递归 并且我陷入了打印字符串所有排列的算法 我用以下方法解决了它贝尔算法 http programminggeeks com bell algorithm for permutation 用于排列 但我无法理解递归方法 我在
  • Java 中修剪字符串的可能前缀

    I have String str 我想从中提取不包括可能的前缀的子字符串 abc 我想到的第一个解决方案是 if str startsWith abc return str substring abc length return str
  • 为什么我得到?当我尝试从 java 的文本文件中读取 ä 字符时?

    我正在尝试从文本文件中读取文本 有一些特殊字符 如 和 当我制作一个字符串并打印出该字符串时 我得到 来自这些特殊字符 我正在使用以下代码 File fileDir new File files myfile txt BufferedRea
  • 文件 ReadAllLines 将外语变成乱码 (�)

    我正在创建一个工具来替换文本文件中的某些文本 我的问题是 File ReadAllLines 将希伯来字符变成乱码 奇怪的问号 有谁知道为什么会发生这种情况 请注意 我在游戏等中确实遇到希伯来语问题 在记事本中 我无法保存希伯来语文档 我可
  • Windows 上的本机窄字符串编码是什么?

    Subversion API 有一个功能数量 http subversion apache org docs api latest svn utf 8h html用于从 本机编码 字符串转换为以 UTF 8 编码的字符串 我的问题是 Win
  • 结构中字符串的管理

    我知道字符串的长度是可变的 因此它们需要内存中的可变空间来存储 当我们在 a 中定义一个字符串项时struct the struct的大小的长度将是可变的 较旧的语言通过使用固定长度的字符串来管理此问题 但是 C 中没有办法定义固定长度的字
  • 第一个字母改为大写

    是否有其他版本可以使每个字符串的第一个字母大写 并且对于 flac perl 也使用 FALSE name lt hallo gsub alpha U 1 name perl TRUE 你可以尝试这样的事情 name lt hallo pa
  • string.Equals (c#) 的区域性参数何时真正产生影响的示例?

    我不完全理解 string Equals 的第二个参数 这是因为我找不到任何例子来说明它何时会真正产生影响 例如 无论第二个参数的值如何 除了 IgnoreCase 这里给出的示例都是相同的 http msdn microsoft com
  • perl生成字符串来匹配正则表达式

    我尝试找到一种方法来生成与正则表达式匹配的字符串 例如以下正则表达式 A Z 6 6 A Z2 9 A NP Z0 9 A Z0 9 3 3 0 1 我尝试过 Cpan 上的一些 perl 模块不起作用 gt 字符串 随机 gt 正则表达式
  • python执行列表和函数列表[重复]

    这个问题在这里已经有答案了 我正在将 Python 2 7 与 Autodesk Maya 结合使用 这是我的问题的一个例子 import maya cmds as m def a passedString print this passe
  • 如何在 Fortran 90 中迭代包含数字、单词和空格的字符串?

    文件说明 STL文件由以下部分组成 solid
  • 尽管手册页有免责声明,为什么“strchr”似乎可以使用多字节字符?

    From man strchr char strchr const char s int c strchr 函数返回一个指向字符 c 在字符串 s 中第一次出现的位置的指针 这里 字符 的意思是 字节 这些函数不适用于宽字符或多字节字符 不
  • R 中的匹配和计数字符串(DNA 的 k 聚体)

    我有一个字符串列表 DNA 序列 包括 A T C G 我想找到所有匹配项并插入到表中 该表的列都是这些 DNA 字母表的所有可能组合 4 k k 是每个匹配项的长度 K mer 必须由用户指定 行代表 DNA 字母表的数量在列表中按顺序匹
  • 如何将整个流读入 std::string ?

    我正在尝试将整个流 多行 读入字符串中 我正在使用这段代码 它有效 但它冒犯了我的风格感 当然有更简单的方法吗 也许使用字符串流 void Obj loadFromStream std istream stream std string s
  • 使用 Hibernate 映射 Map

    似乎在我看来 到处都有过时的版本 不再起作用 我的问题看起来很简单 我有一个 Java 类 它映射到 derby 数据库 我正在使用注释 并成功地在数据库中创建了所有其他表 但在这个特定的示例中 我只需要一个 Map 它不使用任何其他类 只

随机推荐

  • 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