Code the Best Damn Thing

Octopress Installation Log
13,484 views, 11 Comments

Octopress是基于jekyll的一个Ruby博客程序, 搭建在github上, 用markdown来写博客 win下装Octopress真是漏洞百出, 简单整理了一下 先装Ruby和Git, 这里不谈了, 然后是安装Octopress 1.安装Octopress git clone git://github.com/imathis/octopress.git blog blog是安装目录文件夹名, 可以改成别的 cd blog 没有问题, 继续 2.bundle install gem install bundler bundle install 在bundle install时如果遇到Gem::InstallError:... Read More

Hello Ruby
17,684 views, 22 Comments

def a(b)
puts "Hello #{b}"
end
a("Ruby")
Hello Ruby

全排列计数
16,373 views, 20 Comments

数字1,2,3总共有多少种组合方式? #include <stdio.h> int main () { printf("1,2,3组合:rn"); int a,b,c,d; d=0; for(a=1;a<4;a++) for(b=1;b<4;b++) for(c=1;c<4;c++) { if(a!=b&&a!=c&&b!=c){ d++; printf("%d%d%d,",a,b,c); } } printf("rn总共%d个",d); } falla@ubuntu:~/桌面$ gcc 3.c falla@ubuntu:~/桌面$ ./a.out 1,2,3组合: 123,132,213,231,312,321, ... Read More

C++

彻底合并wp和Google搜索
16,350 views, 27 Comments

效果: 只调用一个input,不用切换 没用jq,原生js demo: ↑本站顶部 - 输入搜索词后, 按回车键是wordpress自带搜索, 点GOOGLE是用Google搜索 或在此测试: function aa(obj){document.getElementById("xhd_f1").value=obj.value;document.getElementById("xhd_f2").value=obj.value;document.onkeydown = function(evt){ var evt = window.event?window.event:evt; if(evt.keyCode==13) { document.getElementById("sbm1").cl... Read More

JS

简易PHP登录上传程序
19,459 views, 24 Comments

原因是我单独整了个子域名来托管文件提供下载之类的, 然后传文件要上FTP特别麻烦, 于是自己写了个简单的小程序. 实现的功能: 输入正确的用户名和密码后进入上传页面 无刷新上传 上传的文件保存到文件夹 包括三个文件: index.html check_usr.php upload_file.php index.html <html> <body> <form action="/upload/check_usr.php" method="post"> Usr: <input type="text" name="usr" size="40... Read More

Ubuntu装完后要做的几件事
28,386 views, 40 Comments

改hosts 无论哪里,改hosts都是第一件事,没hosts咋google。没google咋活。 在终端输入命令 sudo gedit /etc/hosts 在# The following lines are desirable for IPv6 capable hosts这一行上面粘贴所需的hosts。 然后上google搜胡萝卜,没有重置,DONE! chrome黑屏 多是由于显卡驱动所致,听说ubuntu下的n卡驱动有问题,所以暂时没装,没装的话就在设置-系统,关闭使用硬件加速模式(如果可用)这一选项。就不会黑屏了。 其实li... Read More