python 二叉树行间逆向遍历 将一个二叉树逐行遍历,但是遍历方向逐行翻转import time from collections import defaultdict class Node(object): def __init__(self, value, left, right, depth): self.value = value self.left = left self.right = right self.depth = depth rows = defaultdict(list) def
geek PTAM Compilation on Linux-HowTo 补充内容 Ubuntu上编译PTAM请参考PTAM Compilation on Linux-HowTo 以下为摘取内容The README.txt file shipped with the newest PTAM source code is really old (the cvs repositorys are gone for god’s sake) ! I struggled to get it done
golang GO:The usage of 'defer' defer is very useful in control. It is used within a function.If a function contains one or multiple defer command, it will not really return or finish unless all the functions followed
golang GO:Channel and Select The select statement lets a goroutine wait on multiple communication operations.A select blocks until one of its cases can run, then it executes that case. It chooses one at random if multiple
geek Eigen Matrix在原有大小上增加列 直接上代码 #include <iostream> #include <Eigen/Core> #include <Eigen/Dense> using namespace Eigen; using namespace std; #define ROWS 4 template <typename Derived> void vectorDistance(const EigenBase&
geek NYU黑马小结 项目简介 - 电子扬琴大概是2014年底,参加上海纽约大学的黑客马拉松比赛项目。主要技术###--硬件技术:焊接,小到wii cam 摄像头模块0.5mm的焊盘间距,大到0805电阻电容IIC电平转换电路,都是我们一丝不苟焊接完成--软件技术:1. IR 红外摄像头wii cam的使用2. 压电传感3. Arduino 编程应用场景###很多小孩子都很有可能学习一到两种乐器,其中有很多,其实都是按照家长的意愿在学习。比如有的孩子可能天赋是钢琴,家长却让他学了二胡,有的孩子天赋是扬琴,家长却让学了萨克斯。如果能够在决定学习那种乐器之前就能发现孩子真正的兴趣所在,岂不是更好?我们以扬琴为例,在还没有决定是否学习之前,铺上一块扬琴桌布,先让孩子完成测试,
geek Intel Galileo Gen2 有线网络上网 在DeepinLinux中操作,首先要安装minicomsudo apt-get update sudo apt-get install minicom 然后配置minicomsudo -s minicom -s 配置好后连上板子,在终端输入minicom 来访问Intel Galileo2开发板,用户名root,无密码插上网线之后,进行如下操作来配置有线网络ifconfig eth0 down ifconfig eth0 192.168.199.173 netmash 255.255.255.0 up
geek ECS上proftpd配置方法 通过root身份登录,进行接下来的配置添加用户组、添加用户groupadd ftpusers useradd -d /mnt/site/site1 -g ftpusers -s /sbin/nologin weba passwd weba useradd -d /mnt/ftp -g ftpusers -s /sbin/nologin webb passwd webb 修改配置文件 proftpd.confDefaultRoot ~ <
geek 阿里云ECS数据磁盘挂载 首先查看所有磁盘fdisk -l 发现系统盘已经挂载,还有个 /dev/xvdb 64.4GB没有挂载使用fdisk /dev/xvdb 并选择 n,p,1,最后输入wq回车保存退出格式化磁盘mkfs.ext3 /dev/xvdb1 使系统自动挂载该磁盘echo "/dev/xvdb1 /mnt ext3 defaults 0 0" >> /etc/fstab 这样系统启动的时候就会自动挂载使用mount -a 手动挂载一次即可。
geek Arduino 使用的一些细节问题 使用Arduino在做实验的时候,遇到了一些问题,这里总结一下。MIDI 库从Arduino网上下载的MIDI库 在导入的时候应该先将解压出来的文件夹中的src文件夹的内容移到顶层,这样在导入之后,选择“skecth->import library->MIDI”才会自动导入头文件。在使用MIDI库的时候,需要设置一下串口的波特率。这个很重要。例如,导入example里的 MIDI_Basic_IO 例子,虽然可以编译下载,但是,在使用 HairlessMIDI进行播放声音的时候是没有声音的,需要在例子的setup()函数最后添加一句设置串口波特率的语句。最终例子代码应当如下:#include <
docker Test open vswitch basic performance with iperf3 using Docker Use ovs(openvswitch) as docker network switch and test its performance.Install OVSsudo apt-get install openvswitch-switchInstall ovs-docker utilitycd /usr/bin wget https://raw.githubusercontent.com/openvswitch/ovs/master/utilities/ovs-docker chmod a+rwx
geek Host blogs on github pages using Ghost Github pages provide a method to host your blogs and stories without AWS or any other Cloud platform.Here are some brief steps you need to do to start posting blogs in this
Getting Started Welcome to Ghost Welcome, it's great to have you here. 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 familiar with everything in no time.
Getting Started Writing posts with Ghost ✍️ Getting started with the editor is simple, with familiar formatting options in a functional toolbar and the ability to add dynamic content seamlessly.
Getting Started Publishing options The Ghost editor has everything you need to fully optimise your content. This is where you can add tags and authors, feature a post, or turn a post into a page.
Getting Started Managing admin settings There are a couple of things to do next while you're getting set up: making your site private and inviting your team.
Getting Started Organising your content Ghost has a flexible organisational taxonomy called tags which can be used to configure your site structure using dynamic routing.
Getting Started Apps & integrations There are three primary ways to work with third-party services in Ghost: using Zapier, editing your theme, or using the Ghost API.
Getting Started Creating a custom theme 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 most purposes.