欢迎来到 艾瑞可erik 的魔法世界 🧙‍♂️

给我一个需求,还你一个项目——别管它是什么。这就是全栈。

📚 292 篇文章 🏷️ 507 个标签 📂 90 个分类

🔥 最新文章

openresty的介绍

今天给一家公司投简历,问我用过openresty没,确实没用过,回答后没结果了。这就查了查。

官方介绍如下:

        OpenResty® 是一个基于 Nginx 与 Lua 的高性能 Web 平台,其内部集成了大量精良的 Lua 库、第三方模块以及大多数的依赖项。用于方便地搭建能够处理超高并发、扩展性极高的动态 Web 应用、Web 服务和动态网关。

OpenResty® 通过汇聚各种设计精良的 Nginx 模块(主要由 OpenResty 团队自主开发),从而将 Nginx 有效地变成一个强大的通用 Web 应用平台。这样,Web 开发人员和系统工程师可以使用 Lua 脚本语言调动 Nginx 支持的各种 C 以及 Lua 模块,快速构造出足以胜任 10K 乃至 1000K 以上单机并发连接的高性能 Web 应用系统。

OpenResty® 的目标是让你的Web服务直接跑在 Nginx 服务内部,充分利用 Nginx 的非阻塞 I/O 模型,不仅仅对 HTTP 客户端请求,甚至于对远程后端诸如 MySQL、PostgreSQL、Memcached 以及 Redis 等都进行一致的高性能响应。

An Introduction to OpenResty

Today I sent my resume to a company, and they asked whether I had used openresty. I really had not, so after I answered there was no result. So I looked into it.

The official introduction is as follows:

        OpenResty® is a high-performance web platform based on Nginx and Lua, with a large number of fine Lua libraries, third-party modules and most of their dependencies bundled in. It is used to conveniently build dynamic web applications, web services and dynamic gateways that can handle extremely high concurrency and are highly scalable.

OpenResty® brings together various well-designed Nginx modules (mostly developed by the OpenResty team itself), effectively turning Nginx into a powerful general-purpose web application platform. In this way, web developers and system engineers can use the Lua scripting language to invoke the various C and Lua modules supported by Nginx, quickly building high-performance web application systems capable of handling 10K or even over 1000K concurrent connections on a single machine.

OpenResty®'s goal is to let your web service run directly inside the Nginx service, making full use of Nginx's non-blocking I/O model, delivering consistent high-performance responses not only to HTTP client requests but even to remote backends such as MySQL, PostgreSQL, Memcached and Redis.

nosql数据库的介绍

根据NoSQL官网查阅,结合网上资料做一个简单介绍。

键值数据库

  • 目前使用较多的

  • 特点:

      基于内存数据处理,相对速度最快;数据存储结构最简单,只有key-value形式;对值的查询统计功能支持很弱;由于基于内存数据处理,数据持久性相对较弱。但,redis具备大数据管理能力;事务处理能力弱。
    

An Introduction to NoSQL Databases

Based on what I found at the official NoSQL site, here is a brief introduction combined with material from around the web.

Key-value databases

  • The more widely used ones

  • Characteristics:

      Processes data in memory, so it is relatively the fastest; the data storage structure is the simplest, with only the key-value form; support for querying and aggregating values is very weak; because data is processed in memory, data durability is relatively weak. But redis does have big-data management capabilities; transaction support is weak.
    

查找与排序

查找

1.顺序查找

  • 思路:从线性表的第一个元素开始,逐个将线性表中的元素与被查元素进行比较,如果相等,则查找成功,停止查找;若整个线性表扫描完毕,仍未找到与被查元素相等的元素,则表示线性表中没有要查找的元素,查找失败。
  • 最好情况下,第一个元素就是要查找的元素,则比较次数为1次
  • 最坏情况下,最后一个元素才是要找的元素,或者在线性表中,没有要查找的元素,则需要与线性表中所有的元素比较,比较次数为n次
  • 平均情况下,大约需要比较n/2次

Searching and Sorting

Searching

1.Sequential search

  • Idea: start from the first element of the linear list and compare the elements of the list with the element being searched for one by one. If they are equal, the search succeeds and stops; if the whole linear list has been scanned and no element equal to the target has been found, that means the linear list does not contain the element being searched for, and the search fails.
  • In the best case, the first element is the one being searched for, so the number of comparisons is 1
  • In the worst case, the last element is the one being searched for, or the linear list contains no such element at all; then every element in the list must be compared, and the number of comparisons is n
  • On average, about n/2 comparisons are needed

树与二叉树

树

树,不是我们常见的长在土里的树木,而是计算机语言中的一种结构。

  • 树是一种简单的非线性结构

    • 父节点
      • 树结构中,每一个节点只有一个前件,称为该节点的父节点;没有前件的节点只有一个,称为树的根节点,简称树的根
    • 子节点和叶子节点
      • 树结构中,每一个节点可以有多个后件,称为该节点的子节点。没有后件的节点称为叶子节点

Trees and Binary Trees

Trees

A tree is not the kind of tree we usually see growing in the soil, but rather a structure in computer languages.

  • A tree is a simple non-linear structure

    • Parent node
      • In a tree structure, every node has only one predecessor, which is called that node’s parent node; there is exactly one node with no predecessor, and it is called the root node of the tree, or simply the root of the tree
    • Child nodes and leaf nodes
      • In a tree structure, every node can have multiple successors, which are called that node’s child nodes. A node with no successors is called a leaf node

算法、数据结构、线性结构、栈、队列

算法

1.算法的基本特征

  • 可行性
    • 步骤实现,执行结果达到预期
      • 确定性
    • 步骤明确
      • 有穷性
    • 有限的时间完成
      • 拥有足够的情报
    • 拥有足够的输入信息和初始化信息

Algorithms, Data Structures, Linear Structures, Stacks, Queues

Algorithms

  1. Basic characteristics of an algorithm

    • Feasibility
      • The steps are implementable and the execution result meets expectations
    • Determinacy
      • The steps are unambiguous
    • Finiteness
      • It completes in a finite amount of time
    • Possessing sufficient intelligence
      • Having enough input information and initialization information

关于kali的一些事

kali用了有一段时间了,谈谈关于使用上的一些事吧。
目前我自己用的就是kali系统,安装在笔记本电脑上,中间也因为升级导致系统崩溃,自己也折腾过好几次。


安装完系统第一件事就是配置软件库

编辑库源指定地址文件(没用leafpad是没安装,用vi或者vim也可以命令操作)

sudo leafpad /etc/apt/sources.list

复制以下库地址

A Few Things About Kali

I’ve been using Kali for a while now, so let me talk about a few things regarding its use.
Right now I run Kali myself, installed on a laptop. Along the way upgrades have crashed the system, and I’ve had to mess around with it several times myself.


The first thing to do after installing the system is to configure the software repositories.

Edit the file that specifies the repository source addresses (I didn’t use leafpad because it wasn’t installed; vi or vim works fine for the command too):

sudo leafpad /etc/apt/sources.list

Copy the repository addresses below:

老鸟程序员才知道的40个小技巧

来源:知乎,作者:大狐狸

链接:https://www.zhihu.com/question/36426051/answer/76031743

1.重构是程序员的主力技能。

2.工作日志能提升脑容量。

3.先用profiler调查,才有脸谈优化。

4.注释贵精不贵多。杜绝大姨妈般的“例注”。漫山遍野的碎碎念注释,实际就是背景噪音。

5.普通程序员+google=超级程序员。

40 Little Tips Only Veteran Programmers Know

Source: Zhihu, author: 大狐狸

Link: https://www.zhihu.com/question/36426051/answer/76031743

  1. Refactoring is a programmer’s main skill.
  1. A work log expands your brain capacity.
  1. Profile first — only then do you have the face to talk about optimization.
  1. Comments are valued for quality, not quantity. Do away with period-like “routine comments”. Comments carped on all over the place are really just background noise.
  1. An ordinary programmer + google = a super programmer.

容器发展史

一、缘起

1.1、鸿蒙

在上古时期,天地初开,一群称之为 “运维” 的人们每天在一种叫作 “服务器” 的神秘盒子中创造属于他们的世界;他们在这个世界中每日劳作,一遍又一遍的写入他们的历史,比如搭建一个 nginx、布署一个 java web 应用…

大多数人其实并没有那么聪明,他们所 “创造” 的事实上可能是有人已经创造过的东西,他们可能每天都在做着重复的劳动;久而久之,一些人厌倦了、疲惫了…又过了一段时间,一些功力深厚的老前辈创造了一些批量布署工具来帮助人们做一些重复性的劳动,这些工具被起名为 “Asible”、”Chef”、”Puppet” 等等…

A History of Containers

I. The Beginning

1.1. Chaos

In ancient times, when heaven and earth had just been separated, a group of people called “operations” spent every day creating their own world inside a mysterious box called a “server”. In that world they labored daily, writing their history over and over, for example setting up an nginx, deploying a java web application…

Most people aren’t actually that clever. What they “created” may in fact be something someone else had already created, and they probably did the same repetitive work every day. Over time, some grew tired of it, exhausted… After a while longer, some deeply skilled old-timers created batch deployment tools to help people with some of the repetitive labor. These tools were named “Asible”, “Chef”, “Puppet” and so on…

php设计模式

设计模式 一书介绍了很多此类概念。当时,我还在学习面向对象 (OO),因此我发现那本书中有许多概念都很难领会。但是,随着越来越熟悉 OO 概念 —— 尤其是接口和继承的使用 —— 我开始看到设计模式中的实际价值。作为一名应用程序开发人员,即使从不了解任何模式或者如何及何时使用这些模式,对您的职业生涯也没有什么大的影响。但是,我发现了解这些模式以及 developerWorks 文章 “五种常见 PHP 设计模式” 中介绍的那些模式的优秀知识后(请参阅 参考资料),您可以完成两件事情:

启用高带宽会话
如果了解设计模式,您将能够更快地构建可靠的 OO 应用程序。但当整个开发团队知道各种模式时,您可以突然拥有非常高的带宽会话。您不再需要讨论将到处使用的所有类。相反,您可以与其他人谈论模式。“我要在这里引用一个单例(singleton),然后使用迭代器遍历对象集合,然后……” 比遍历构成这些模式的类、方法和接口快很多。单是通信效率一项就值得花时间以团队的形式通过会话来研究模式。

PHP Design Patterns

The book Design Patterns introduces a lot of these concepts. At the time I was still learning object orientation (OO), so I found many of the concepts in that book very hard to grasp. But as I became more and more familiar with OO concepts — especially the use of interfaces and inheritance — I began to see the practical value in design patterns. As an application developer, even if you never learn about any pattern, or how and when to use these patterns, it won’t have much of an impact on your career. But I found that after gaining a solid knowledge of these patterns and the ones introduced in the developerWorks article “Five Common PHP Design Patterns” (see Resources), you can accomplish two things:

Enabling high-bandwidth sessions
If you understand design patterns, you’ll be able to build reliable OO applications faster. But when the whole development team knows the various patterns, you suddenly have very high-bandwidth sessions. You no longer need to discuss all the classes that will be used everywhere. Instead, you can talk to the others in terms of patterns. “I’m going to reference a singleton here, then use an iterator to walk the object collection, and then…” is much faster than walking through the classes, methods and interfaces that make up those patterns. The communication efficiency alone makes it worth spending time studying patterns through sessions as a team.