Getting Started Welcome to Ghost Hey! Welcome to Ghost, it's great to have you :) We know that first impressions are important, so we've populated your new site with some initial Getting Started posts that will help you get
Getting Started Using the Ghost editor Ghost uses a language called Markdown to format text. When you go to edit a post and see special characters and colours intertwined between the words, those are Markdown shortcuts which tell Ghost
Getting Started Organising your content with tags Ghost has a single, powerful organisational taxonomy, called tags. It doesn't matter whether you want to call them categories, tags, boxes, or anything else. You can think of Ghost tags a lot like
Getting Started Managing Ghost users Ghost has a number of different user roles for your team Authors The base user level in Ghost is an author. Authors can write posts, edit their own posts, and publish their own
Getting Started Making your site private Sometimes you might want to put your site behind closed doors If you've got a publication that you don't want the world to see yet because it's not ready to launch, you can
Getting Started Advanced Markdown tips There are lots of powerful things you can do with the Ghost editor If you've gotten pretty comfortable with all the basics of writing in Ghost, then you may enjoy some more advanced
Getting Started Setting up your own Ghost theme Creating a totally custom design for your publication Ghost comes with a beautiful default theme called Casper, which is designed to be a clean, readable publication layout and can be easily adapted for
PHP CentOS 7 安装PHP开发环境 上一篇《Mac上使用VirtualBox虚拟CentOS》安装好了VirtualBox并在上面安装好CentOS7,LNMP环境就已经有了L。为了不那么折腾,这里都用yum进行安装,这里主要记录基本的安装,以及使用的yum源。 PHP7&PHP-FPM Nginx 1.10+ MySQL 5.7 安装PHP&PHP-FPM### 首先更新一下CentOS7系统,对系统软件做一下升级,这里不升级内核。 //使用root权限,注意这里使用upgrade,而不是update(它会升级内核,这里我们不需要) yum upgrade 我需安装最新的PHP,默认源安装的PHP版本是5.4左右,
virtualbox Mac上使用VirtualBox虚拟CentOS 最近工作上需要写些PHP代码,我的Mac笔记本上并没有安装相关的环境,周末折腾环境安装各种软件和配置,参考的资料又比较零散,整个过程下来用了不少时间。我把过程记录下来方便以后遇到能够快速查阅,这不是一篇教程,姑且当成是备忘笔记吧。 我的Mac系统是macOS Sierra,这部分安装VirtualBox并在里面安装CentOS 7。 VirtualBox 5 CentOS 7 Minimal VirtualBox(下载链接)安装很简单,下载之后点击.dmg文件按指引安装即可。除了VirtualBox以外,ParallelsDesktop、VMware Fusion8也是可以的,但都是收费软件。我选择VirtualBox是因为它轻量、开源、免费、跨平台的,功能上能满足我的需求。 安装CentOS#
Skip List 图解Skip List 如果说要学习一个简单却非常实用的“高级”数据结构,那么Skip List一定不能错过。它的提出已有二十多年[Pugh, W. (1990)],却依旧应用广泛(Redis、LevelDB等)。作为平衡树(AVL、红黑树、伸展树、树堆)的替代方案,虽然它性能不如平衡树稳定,但是在实现难度上却很有优势,可算是高性价数据结构。 Skip List是什么### 我们常用数组和链表来组织数据,对于已排序的数据,数组的查询时间复杂度可以是$\Theta(lgn)$(二分查找),插入和删除都是$\Theta(n)$。 链表提供了一种更加灵活的组织方式,
C++ 单例模式(Singleton)及其C++实现 众多设计模式中,单例模式比较常见的一种,面试和工作中也会经常接触到。本文以一个C++开发者的角度来探讨单例模式几种典型实现。设计模式经典GoF定义的单例模式需要满足以下两个条件: 保证一个类只创建一个实例。 提供对该实例的全局访问点。 如果系统有类似的实体(有且只有一个,且需要全局访问),那么就可以将其实现为一个单例。实际工作中常见的应用举例 日志类,一个应用往往只对应一个日志实例。 配置类,应用的配置集中管理,并提供全局访问。 管理器,比如windows系统的任务管理器就是一个例子,总是只有一个管理器的实例。 共享资源类,加载资源需要较长时间,使用单例可以避免重复加载资源,并被多个地方共享访问。 Lazy Singleton#### 首先看GoF在描述单例模式时提出的一种实现,教科书式的例子,对C++有些经验应该对该实现都有些印象 //头文件中 class
Linux Linux动态库相关知识整理 动态库和静态库在C/C++开发中很常见,相比静态库直接被编译到可执行程序, 动态库运行时加载使得可执行程序的体积更小,更新动态库可以不用重新编译可执 行程序等诸多好处。作者是一个Linux后台开发,这些知识经常用到,所以 整理了一下这方面的知识。静态库相对简单,本文只关心Linux平台下的动态库。 创建动态库### 这里我把一个短小却很有用的哈希函数编译成动态库做为示例,ELFhash用于对字符串做哈希,返回一个无符号整数。 //elfhash.h #include <stdio.h> unsigned long ELFhash(const char* key); //elfhash.c #include
C++ C++'s most vexing parse 最近同事在使用C++的时候遇到一个诡异的问题,初始化一个对象的时候构造函数没有被调用。类似的代码如下: #include <iostream> class A { public: A(const std::string& name){ std::cout << name << std::endl; } }; int main() { char szTmp[] = "Hello"