2016年12月26日
摘要:
首先要确保网络畅通,因为该过程要通过网络下载相关的软件包。 在 root 用户下,使用 cd ~/Downloads 命令进入下载文件夹,然后依次输入如下三个命令: [root@prime:~/Documents]$ wget http://mirrors.yun idc.com/epel/6/i3
阅读全文
posted @ 2016-12-26 22:19
HorseShoe2016
阅读(4516)
推荐(0)
摘要:
使用vim命令编辑 /etc/sysconfig/network scripts/ifcfg eth0 文件 vim /etc/sysconfig/network scripts/ifcfg eth0 为了使用静态网络,并禁用ipv6以加速网络,在文件中添加如下文字: DEVICE=eth0 HWA
阅读全文
posted @ 2016-12-26 21:38
HorseShoe2016
阅读(930)
推荐(1)
摘要:
CentOS修改主机名 CentOS7和CentOS6.5 修改主机名的方法略有不同。 通过 hostname 命令可以查看当前的主机名。 1、 临时修改主机名 通过 'hostname 新的主机名' 命令可以设置主机名,但是这个方法在系统重启后就失效了。 2、 CentOS 6.5: 永久性修改主
阅读全文
posted @ 2016-12-26 11:28
HorseShoe2016
阅读(455)
推荐(0)
2016年10月18日
摘要:
《C程序设计语言》练习题 5 10 编写程序 expr,计算从命令行输入的逆波兰表达式的值,其中每个运算符或操作数用一个单独的参数表示。例如,命令 expr 2 3 4 + 计算表达式2x(3+4)的值 算法实现 getfloat.c: // getfloat.c include include i
阅读全文
posted @ 2016-10-18 17:26
HorseShoe2016
阅读(1152)
推荐(0)
2016年10月14日
摘要:
删除源文件注释语句的算法实现 面试某互联网公司,被问到“如何删除源文件中的注释语句?”,写了个很拙劣的算法,还没能考虑到“双引号中的//不用删除”这一环节。 写完后,面试官即说:“为什么不考虑用状态转换机呢?” 状态转换机?什么鬼?怎么用? 书到用时方恨少啊! 回去后赶紧网上搜索“状态转换机”、“删
阅读全文
posted @ 2016-10-14 11:49
HorseShoe2016
阅读(1003)
推荐(0)
2016年9月21日
摘要:
一道容易出错的C++笔试题 求下面代码的输出内容: int main(int argc,char argv[]) { char str1[]="Hello"; char str2="World"; cout 解析: str1指向的是字符串 "Hello" 的首地址,但 str1 同时也是一个字符数组
阅读全文
posted @ 2016-09-21 18:08
HorseShoe2016
阅读(243)
推荐(0)
2016年9月14日
摘要:
1.首先确认服务器出于安全的状态,也就是没有人能够任意地连接MySQL数据库。 因为在重新设置MySQL的root密码的期间,MySQL数据库完全出于没有密码保护的 状态下,其他的用户也可以任意地登录和修改MySQL的信息。可以采用将MySQL对 外的端口封闭,并且停止Apache以及所有的用户进程
阅读全文
posted @ 2016-09-14 12:23
HorseShoe2016
阅读(168)
推荐(0)
2016年9月12日
摘要:
C++类的大小 (i) 如下代码: include using namespace std; class CBase { }; class CDerive :public CBase { }; int main(int argc, char argv[]) { CDerive p[3]; cout
阅读全文
posted @ 2016-09-12 13:16
HorseShoe2016
阅读(203)
推荐(0)
摘要:
C++类的数组中构造函数和析构函数的调用顺序(2) 对于如下的代码: include using namespace std; class CBase { private: static int count; public: int id; public: CBase() { id = CBase:
阅读全文
posted @ 2016-09-12 13:02
HorseShoe2016
阅读(2494)
推荐(0)
摘要:
基类和派生类:构造函数和析构函数的执行顺序 在Visual Studio中,新建控制台工程,构造类如下: include using namespace std; class CBase { public: CBase() { cout Test.exe CBase():Constructor CD
阅读全文
posted @ 2016-09-12 12:00
HorseShoe2016
阅读(4417)
推荐(0)
2016年9月7日
摘要:
在Android Studio中新建了一个 setting.xml 文件,布局好文件后,从 Text 界面切换到 Design 界面,显示了如下错误: 网上搜寻 The graphics preview in the layout editor may not be accurate ,还是没有解决
阅读全文
posted @ 2016-09-07 11:22
HorseShoe2016
阅读(2831)
推荐(0)
2016年9月5日
摘要:
395. Longest Substring with At least K Repeating Characters Find the length of the longest substring T of a given string (consists of lowercase letter
阅读全文
posted @ 2016-09-05 22:18
HorseShoe2016
阅读(2854)
推荐(0)
摘要:
394. Decode String Given an encoded string, return it's decoded string. The encoding rule is: , where the encoded_string inside the square brackets is
阅读全文
posted @ 2016-09-05 22:07
HorseShoe2016
阅读(960)
推荐(0)
摘要:
393. UTF 8 Validation A character in UTF8 can be from 1 to 4 bytes long, subjected to the following rules: 1. For 1 byte character, the first bit is a
阅读全文
posted @ 2016-09-05 21:52
HorseShoe2016
阅读(681)
推荐(0)
摘要:
392. Is Subsequence Given a string s and a string t , check if s is subsequence of t . You may assume that there is only lower case English letters in
阅读全文
posted @ 2016-09-05 21:36
HorseShoe2016
阅读(1873)
推荐(0)
2016年9月3日
摘要:
5. Longest Palindromic Substring Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, a
阅读全文
posted @ 2016-09-03 20:11
HorseShoe2016
阅读(160)
推荐(0)
2016年9月1日
摘要:
391. Perfect Rectangle Given N axis aligned rectangles where N 0, determine if they all together form an exact cover of a rectangular region. Each rec
阅读全文
posted @ 2016-09-01 19:58
HorseShoe2016
阅读(841)
推荐(0)
2016年8月30日
摘要:
390. Elimination Game There is a list of sorted integers from 1 to n. Starting from left to right, remove the first number and every other number afte
阅读全文
posted @ 2016-08-30 22:57
HorseShoe2016
阅读(1003)
推荐(0)
2016年8月29日
摘要:
问题描述 今天用Android Studio开发了一个简单的调用摄像头的App,结果想调试的时候发现选择调试设备的对话框中,手机名称后面总是跟着一个[OFFLINE]的标识,只能选择启动AVD来进行调试,但手机摄像头的App在AVD中是无法调试的。 网上找了很多解决方案: 1. 说是 adb 的版本
阅读全文
posted @ 2016-08-29 11:55
HorseShoe2016
阅读(5665)
推荐(0)
2016年8月22日
摘要:
水平遍历二叉树 题目描述 对于一棵给定的二叉树: 1 / \ 2 3 / \ / \ 4 5 6 7 其水平遍历结果为: 1,2,3,4,5,6,7 算法分析 考虑使用队列来循环遍历该二叉树,首先将根节点放进队列中,循环判断队列是否为空,如果不为空, 则说明还有数据没有遍历到,所以取出队首节点,将队
阅读全文
posted @ 2016-08-22 16:25
HorseShoe2016
阅读(679)
推荐(0)