根据NoSQL官网查阅,结合网上资料做一个简单介绍。
最新文章
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.
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
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
- Parent node
Algorithms
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
- Feasibility
kali用了有一段时间了,谈谈关于使用上的一些事吧。
目前我自己用的就是kali系统,安装在笔记本电脑上,中间也因为升级导致系统崩溃,自己也折腾过好几次。
安装完系统第一件事就是配置软件库
编辑库源指定地址文件(没用leafpad是没安装,用vi或者vim也可以命令操作)
sudo leafpad /etc/apt/sources.list
复制以下库地址
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:
来源:知乎,作者:大狐狸
链接:https://www.zhihu.com/question/36426051/answer/76031743
1.重构是程序员的主力技能。
2.工作日志能提升脑容量。
3.先用profiler调查,才有脸谈优化。
4.注释贵精不贵多。杜绝大姨妈般的“例注”。漫山遍野的碎碎念注释,实际就是背景噪音。
5.普通程序员+google=超级程序员。
Source: Zhihu, author: 大狐狸
Link: https://www.zhihu.com/question/36426051/answer/76031743
- Refactoring is a programmer’s main skill.
- A work log expands your brain capacity.
- Profile first — only then do you have the face to talk about optimization.
- 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.
- An ordinary programmer + google = a super programmer.
一、缘起
1.1、鸿蒙
在上古时期,天地初开,一群称之为 “运维” 的人们每天在一种叫作 “服务器” 的神秘盒子中创造属于他们的世界;他们在这个世界中每日劳作,一遍又一遍的写入他们的历史,比如搭建一个 nginx、布署一个 java web 应用…
大多数人其实并没有那么聪明,他们所 “创造” 的事实上可能是有人已经创造过的东西,他们可能每天都在做着重复的劳动;久而久之,一些人厌倦了、疲惫了…又过了一段时间,一些功力深厚的老前辈创造了一些批量布署工具来帮助人们做一些重复性的劳动,这些工具被起名为 “Asible”、”Chef”、”Puppet” 等等…
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…
设计模式 一书介绍了很多此类概念。当时,我还在学习面向对象 (OO),因此我发现那本书中有许多概念都很难领会。但是,随着越来越熟悉 OO 概念 —— 尤其是接口和继承的使用 —— 我开始看到设计模式中的实际价值。作为一名应用程序开发人员,即使从不了解任何模式或者如何及何时使用这些模式,对您的职业生涯也没有什么大的影响。但是,我发现了解这些模式以及 developerWorks 文章 “五种常见 PHP 设计模式” 中介绍的那些模式的优秀知识后(请参阅 参考资料),您可以完成两件事情:
启用高带宽会话
如果了解设计模式,您将能够更快地构建可靠的 OO 应用程序。但当整个开发团队知道各种模式时,您可以突然拥有非常高的带宽会话。您不再需要讨论将到处使用的所有类。相反,您可以与其他人谈论模式。“我要在这里引用一个单例(singleton),然后使用迭代器遍历对象集合,然后……” 比遍历构成这些模式的类、方法和接口快很多。单是通信效率一项就值得花时间以团队的形式通过会话来研究模式。
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.
设置时区
date_default_timezone_set(“Asia/Shanghai”);
date_default_timezone_set(‘PRC’);//这两种方法效果相同
1
2
时间戳转日期,可以用date(‘Y-m-s h:i:s’, 具体时间戳来实现)
日期转换时间戳,用strtotime(“date()”).
Set the timezone
date_default_timezone_set(“Asia/Shanghai”);
date_default_timezone_set(‘PRC’);//these two methods have the same effect
1
2
To convert a timestamp to a date, you can use date(‘Y-m-s h:i:s’, the specific timestamp)
To convert a date to a timestamp, use strtotime(“date()”).
1
First, let me ask everyone two questions:
1) Why is it that the people who are best at climbing trees and farming can’t get bonus points on the college entrance exam, while Jiang Fangzhou, who writes good essays, Kobe, who plays basketball well, and Liu Xiang, who runs the hurdles fast, are all fought over by universities?
2) Why is it that the Jews, after more than two thousand years of unrelenting oppression in history, have produced so many remarkable people in modern and contemporary times?
Don’t rush to answer these two questions; read the whole article and you’ll naturally understand.
Now let’s first state the main point of this article: the reason you live so hard in the city and success stays so far out of reach may be that you are still living, working, socializing, and investing with the thinking and habits of an agrarian society — you haven’t adapted to what an industrial and commercial era requires of you.