摘要: 红黑树学习笔记 红黑树是一种二叉查找树,接近平衡的,确保没有一条路径比其他路径长2倍。 性质: 1)每个结点要么是红的,要么是黑的。 2)根结点是黑的。 3)每个叶子结点,即空结点是黑的,叶子是NIL结点 4)如果一个结点是红的,那么他的两个孩子是黑的 5)对每个结点,从该结点到其子孙结点的所有路径包含相同数目的的黑结点 性质4暗示着任何一个简单路径上不能有两个毗连的红色节点,这样,最短的可能... 阅读全文
posted @ 2017-02-13 16:52 陈溜溜 阅读(202) 评论(0) 推荐(0) 编辑
摘要: mac 禁用自带键盘 然后发现下面的都没什么作用,连续按五次option就行了。 另外还可以用终端禁用,打开终端输入下面的代码就可以了: sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/ 复制代码 恢复(后面有个换行符记... 阅读全文
posted @ 2017-02-13 16:50 陈溜溜 阅读(3282) 评论(0) 推荐(0) 编辑
摘要: c++ 常见函数运用 lower_bound(a,a+n,x)-a;//二分查找x tolower(ch);//小写化 在c++中判断map有没出现过该字符: if( ! map.count(s)) map[s] = 0; else map[s]++; map::iterator it; for(it=m.begin();it!=m.end();++... 阅读全文
posted @ 2017-02-13 16:49 陈溜溜 阅读(238) 评论(0) 推荐(0) 编辑
摘要: mac 显示隐藏文件 defaults write com.apple.finder AppleShowAllFiles -bool true 此命令显示隐藏文件 defaults write com.apple.finder AppleShowAllFiles -bool false 此命令关闭显示隐藏文件 命令运行之后需要重新加载Finder:快捷键option+command+esc,选... 阅读全文
posted @ 2017-02-13 16:48 陈溜溜 阅读(1202) 评论(0) 推荐(0) 编辑
摘要: defaults write com.apple.dock autohide-time-modifier -float 0.3;killall Dock有时候mac上 设置dock栏 隐藏显示时 它的反应速度 实在 太慢了,可以通过更改上面的值来 设置反应时间 阅读全文
posted @ 2017-02-13 16:47 陈溜溜 阅读(740) 评论(0) 推荐(0) 编辑
摘要: linux下解析域名 vi /etc/resolv.confnameserver 208.67.222.222 #opendnsnameserver 208.67.220.220sudo vim /etc/network/interfacesnull 阅读全文
posted @ 2017-02-13 16:44 陈溜溜 阅读(338) 评论(0) 推荐(0) 编辑
摘要: shell脚本内sudo无需输入密码 echo "password" | sudo -S sh -c "cat hosts.patch >> /etc/hosts"原理:管道null 阅读全文
posted @ 2017-02-13 16:43 陈溜溜 阅读(5702) 评论(0) 推荐(0) 编辑
摘要: ubuntu下更新java版本 1.在官网下要更新的java版本的jdk2.mov 到以前的安装路径下,如/usr/lib/jdk/3.改PATH,修改~/.bashrc 里JAVAHOME路径4.更新默认jdk# update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0_05/bin/java 300# up... 阅读全文
posted @ 2017-02-13 16:42 陈溜溜 阅读(5149) 评论(0) 推荐(0) 编辑
摘要: 交叉编译libupnp 1.从Makeconfig中拿到CFLAGS,LDFLAGS等编译参数,执行./configure 然后再make,make install。 2.拷贝编译出来的动态库和静态库到lib_release下对应的文件夹中,编译出来的库的路径在./configure –prefix=”路径”下。 3.在system/project/TV010XX/Makefi... 阅读全文
posted @ 2017-02-13 16:41 陈溜溜 阅读(1879) 评论(0) 推荐(0) 编辑
摘要: 1.配置nfs 在虚拟机/etc/exports中配置 2.设置板子的ip等 3.挂在虚拟机文件夹:mount -t nfs -o nolock,tcp 172.29.6.89:/home/ice /mnt/hda;cd mnt/hda/.. 4.运行gdbserver:gdbserver 172.29.6.89:2345 ./Play 5.虚拟机运行gdb:/hom... 阅读全文
posted @ 2017-02-13 16:41 陈溜溜 阅读(387) 评论(0) 推荐(0) 编辑
摘要: /etc/network/interfaces# This file describes the network interfaces available on your system# # and how to activate them. For more information, see interfaces(5).## # The loopback network interfaceaut... 阅读全文
posted @ 2017-02-13 16:40 陈溜溜 阅读(144) 评论(0) 推荐(0) 编辑
摘要: su 到管理员用户sudo fdisk -lmount /dev/sde1 /mnt/usb如果没有usb目录mkdirumount /mnt当然 并不建议这样做 并不安全null 阅读全文
posted @ 2017-02-13 16:39 陈溜溜 阅读(488) 评论(0) 推荐(0) 编辑
摘要: echo 8 > /proc/sys/kernel/printk 阅读全文
posted @ 2017-02-13 16:37 陈溜溜 阅读(1366) 评论(0) 推荐(0) 编辑
摘要: ALOGD("dump callstack"); android::CallStack stack; stack.update( ); stack.log("CALLSTACK"); //callstack LOG_TAG要#include 看是誰call的用logcat | grep CALLSTACKnull 阅读全文
posted @ 2017-02-13 16:37 陈溜溜 阅读(3271) 评论(0) 推荐(0) 编辑
摘要: Linux 常用的命令(未完结) Linux 常用的命令(未完结)ducprmrsynctarnohupatvim 编辑后获得权限保存awk格式化输出:过滤:指定分隔符awk 使用系统命令awk未完待续readhistorycutgrepcrontab du du -h -s filename 查看使用空间类似的可以用来查看下载进度和copy进度 cp cp -rf 拷贝目录 rm... 阅读全文
posted @ 2017-02-13 16:35 陈溜溜 阅读(171) 评论(0) 推荐(0) 编辑
摘要: tar -zcvf xxx-$(date +%Y%m%d-%H%M).tar.gz xxx 解压 tar -zxvf xxxnull 阅读全文
posted @ 2017-02-13 16:34 陈溜溜 阅读(367) 评论(0) 推荐(0) 编辑
摘要: du -h --max-depth=10 /home/pms/* | awk '{ if($1 ~ /M/){split($1, arr, "M")}; if(($1 ~ /G/) || ($1 ~ /M/ && arr[1]>200)) {printf "%-10s %s\n", $1, $2} }' | sort -n -rnull 阅读全文
posted @ 2017-02-13 16:34 陈溜溜 阅读(700) 评论(0) 推荐(0) 编辑
摘要: find . -iname '*.conf' | xargs grep "search string" -sl 按文件名查找: -name: 查找时文件名大小写敏感。 -iname: 查找时文件名大小写不敏感 xargs命令: 该命令的主要功能是从输入中构建和执行shell命令 在使用find命令的-exec选项处理匹配到的文件时, find命令将所有匹配到的文件一起传递给... 阅读全文
posted @ 2017-02-13 16:33 陈溜溜 阅读(168) 评论(0) 推荐(0) 编辑
摘要: Ubuntu系统默认状况下的终端样式如下:Ubuntu default terminal's style有个知名的神奇:Oh-My-Zsh 可以让终端及美观又实用:Oh-My-Zsh agnoster theme install powerline font今天就一步步的记录我安装Oh My Zsh 的过程安装Oh-My-Zsh安装Oh-My-Zsh之前必须安装zsh,否则会收到如下提示:Zsh ... 阅读全文
posted @ 2017-02-13 16:32 陈溜溜 阅读(10326) 评论(0) 推荐(1) 编辑
摘要: Linux下的ip命令标签: 网络linux2016-07-10 16:56 486人阅读 评论(0) 收藏 举报 分类:Linux/Unix(31) 目录(?)[+]原文地址:https://Linux.cn/article-3144-1.htmllinux的ip命令和ifconfig类似,但前者功能更强大,并旨在取代后者。使用ip命令,只需一个命令,你就能很轻松地执行一些网络管理任务。ifc... 阅读全文
posted @ 2017-02-13 16:32 陈溜溜 阅读(3090) 评论(0) 推荐(0) 编辑