猴子定理?理论上来说确实存在可能,突发奇想的想试试能不能用rand模拟这种情况,花了一天时间才写出来一个程序,脑子老不活动正在慢慢退化啊!最后还是在纸上折腾了一圈,才终于划定了方法,主要卡在了空格和换行的判断处理上,因为空格不能出现在段落的头部,也不能出现在换行的后面,而且不能重复的连续出现;换行则只能出现在 . 结尾之后,所以需要判断前面两个合法的随机字符才能确定第三个字符的选择,最后用数组模拟 […]
分类: ECW
to record the skills, experience and some other interesting things about the Computer World
raspberry pi试用xware
昨天在Linux上使用迅雷远程下载xware,遇到了挂载设备不能被识别的问题。正好到了周末,换用树莓派再试试,没想还真的可以,先前绕的圈子,到最后才发现已经偏离主题很远。其实在树莓派上运行xware,是非常的简单,只要认准迅雷自己论坛上的内容就行。官方发布的文件中有很多版本的xware,只要找准适合自己系统的版本下载,基本是可以直接运行的,至于挂载设备不被识别,也早有人给出了解决方法,见后面。 这 […]
Linux平台试用Xware
平台:RedHat6.3 x86 首先下载XwareDesktop
|
1 2 3 |
#git clone git://github.com/Xinkai/XwareDesktop.git |
下载完之后,直接进入xware目录,里面有编译好的二进制文件,先执行一下看看:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
[root@test xware]# file portal portal: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.36, not stripped [root@test xware]# ./portal initing... try stopping xunlei service first... killall: ETMDaemon: no process killed killall: EmbedThunderManager: no process killed killall: vod_httpserver: no process killed setting xunlei runtime env... port: 9000 is usable. YOUR CONTROL PORT IS: 9000 starting xunlei service... etm path: /root/XwareDesktop/xware execv: /root/XwareDesktop/xware/lib/ETMDaemon. getting xunlei service info... Connecting to 127.0.0.1:9000 (127.0.0.1:9000) THE ACTIVE CODE IS: ybzftc go to http://yuancheng.xunlei.com, bind your device with the active code. finished. |
没有报错,进入提示的网站,输入ybzftc进行激活,然后新建一个任务,看网页上的状态变成这样: 提示插入外接存储设备才能 […]
git push提示403
RedHat6.3上遇见错误:
|
1 2 3 4 5 |
error: The requested URL returned error: 403 while accessing https://github.com/jma87/socket.git/info/refs fatal: HTTP request failed |
查看github解释,应该是git版本(1.17.1)过低, yum update又提示没有可用的升级包,只能试试用ssh方式,按照官方的说明,配置一下ssh key: 1.生成rsa密钥对
|
1 2 3 4 5 6 7 |
#ssh-keygen -t rsa -b 4096 -C "your_email@example.com" Generating public/private rsa key pair. Enter file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter] Enter passphrase (empty for no passphrase): [Type a passphrase] # Enter same passphrase again: [Type passphrase again] |
"your_email@example.co […]
一款制作U盘启动系统的工具
在网上找到的这款小工具,可以支持很多种系统从ISO到U盘启动的制作,推荐的原因主要是简单实用不罗嗦,工具下载地址如下: (http://www.pendrivelinux.com/universal-usb-installer-easy-as-1-2-3/#button) 用法很简单,贴两张网站上给出的截图就足够了 :Ubuntu Live CD启动之后提示用户登录,这个时候可以检查 […]
windows各种恼人的变量定义
MSDN地址(https://msdn.microsoft.com/en-us/library/cc230347.aspx),原文含所有变量的说明,这里只是将最近经常遇到的,让人混乱的部分粘贴过来,便于实时翻阅 LPCSTR An LPCSTR is a 32-bit pointer to a constant null-terminated string of 8-bit Wind […]
转载Comparing Web Site Projects and Web Application Projects
原文地址(https://msdn.microsoft.com/en-us/library/aa730880(VS.80).aspx#wapp_topic5) Comparing Web Site Projects and Web Application Projects The new Web application project model provides the same Web pro […]
U盘写保护恢复一例
最近用U盘测试Linux内核编译,不知道是VirtualBox出了问题还是频繁操作U盘导致我的2G盘变为只读的了,不管在windows还是Linux上都无法格式化,提示“U盘被写保护”或者“U disk只读”。可以肯定的是我的U盘没有写保护开关,不属于那种高大上的品种。那是什么原因?用fsck检查,确是存在坏块,但是由于read-only,所以无法修复,用 "hdparm -r0 /dev/sdc […]