2017年2月

MongoDB 初窥

这周开始由于项目的原因正式接触 MongoDB,之前稍微看过一点,但没怎么正式用过,一方面是设计思维牢固的钉死在了关系数据库的三大范式上(第四和 BC 有点过了……),另一方面是没有一个机会去做 PHP 以外的站(嗯,因为黄金搭档……)。

所以兜兜转转,稍微介绍一下 MongoDB 的一些事。

引言

MongoDB 是一个 NoSQL (Not Only SQL) 的数据库,提供面向文档的存储,操作简单,天生的分布式,带文件存储功能(GridFS)。

- 阅读剩余部分 -

Xcode 编译 Weex Playground 到 iOS 设备

作为不懂 iOS 开发的萌新,Weex Playground 的 App Store 版本现在还不能运行 Vue 版本,实在是苦大仇深,原生自然比模拟器爽一些,所以试了一下编译到自己的手机上,步骤如下:

首先,git clone git@github.com:alibaba/weex.git

然后如同文档介绍的:

npm install
./start

- 阅读剩余部分 -

双端队列 Deque 与 随机化队列 RandomizedQueue 的实现

双端队列,也就是栈和队列的结合,同时可以从头和尾进行进出栈 / 队列的功能,看一下他的数据结构就懂了:

public class Deque<Item> implements Iterable<Item> {
   public Deque()                           // construct an empty deque
   public boolean isEmpty()                 // is the deque empty?
   public int size()                        // return the number of items on the deque
   public void addFirst(Item item)          // add the item to the front
   public void addLast(Item item)           // add the item to the end
   public Item removeFirst()                // remove and return the item from the front
   public Item removeLast()                 // remove and return the item from the end
   public Iterator<Item> iterator()         // return an iterator over items in order from front to end
   public static void main(String[] args)   // unit testing (optional)
}

双端队列的实现还是比较简单的(虽然实际上还会是踩了一些微小的坑)。

- 阅读剩余部分 -