Geekbaba
jianghao19890829 · 共 45 篇文章
二分查找
<?php function binsearch($n,$array){ $start = 0; $end = count($array); $pos = false; do{ $mid = (int) (($start + $end)/2); if($n > $array[$mid]){ $start = $mid; }else if($n < $array[$mid]){ $end = $mid; }else if($n===$array[$mid]){ return $mid; } if($start===$mid || $end===$mid){ return false; } }w…
2018-04-11T00:23:44Z · 编程语言 · 评论(0)
emacs 的 ecb 和 cedet
在 sf.net 搜索ecb 和 cedet 并且下载加压到自己的目录 加入 如下配置代码 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Cedet 1.1 ;; (load-file "~/.emacs.d/plugins/cedet-1.1/common/cedet.el") (global-ede-mode 1) ; Enable the Project management system (semantic-load-enable-code-helpers) ; Enable prototype help and smart completion (global…
2013-04-20T18:35:15Z · 编程语言 · 评论(0)
emacs & auctex
首先需要 安装 texlive 下载texlive http://www.tug.org/texlive/ windows8 图文安装 教程 http://www.dante.de/tex/tl-install-windows/installation-einfach.html 下载pdf阅读器 http://blog.kowalczyk.info/software/sumatrapdf/downloadafter.html 下载 auctex http://www.gnu.org/software/auctex/download-for-windows.html auctex 简介 为何选…
2013-04-17T23:08:26Z · 开源软件 · 评论(0)
emacs & auto-complete
下载最新版本 http://cx4a.org/software/auto-complete/#Latest_Stable 解压到 ~/.emacs.d/plugins/auto-complete-1.3.1 然后更改.emacs 下载auto math git clone https://github.com/vitoshka/ac-math.git ;;auto-complete (add-to-list 'load-path "~/.emacs.d/plugins/auto-complete-1.3.1") (require 'auto-complete-config) (add-to-…
2013-04-17T22:34:31Z · 开源软件 · 评论(0)
emacs & yasnippet
首先把YAsnippet 检出来 git clone https://github.com/capitaomorte/yasnippet 我是把它放到 ~/.emacs.d/plugins 下的 然后在.emacs 里面加入如下代码 (add-to-list 'load-path "~/.emacs.d/plugins/yasnippet") (require 'yasnippet) (yas/global-mode 1) git clone git://github.com/rvf0068/yasnippets.git 复制yasnippets/org-mode目录到yasnippet/s…
2013-04-16T16:01:26Z · 开源软件 · 评论(0)
emacs & w3m 配置
这段代码也是我在网上找得 但是比较好使的.下载附件解压到如图的配置目录内 并且 添加如下代码 就可以了 (add-to-list 'load-path "~/.emacs.d/w3m-lisp") ;;w3m所需要的lisp文件,所在路径 (add-to-list 'exec-path "~/.emacs.d/w3m") ;;指定w3m可执行程序,所在的执行路径 (require 'w3m-load) (setq w3m-use-favicon nil) (setq w3m-command-arguments '("-cookie" "-F")) (setq w3m-use-cookies …
2013-04-12T16:06:56Z · 开源软件 · 评论(0)
安装 m4 autoconf automake libtool
###安装m4 wget http://mirrors.kernel.org/gnu/m4/m4-1.4.13.tar.gz && tar -xzvf m4-1.4.13.tar.gz && cd m4-1.4.13 && ./configure --prefix=/usr/local make && make install cd .. ###安装autoconf wget http://mirrors.kernel.org/gnu/autoconf/autoconf-2.65.tar.gz && tar -xzvf autoconf-2.65.tar.gz && cd autoconf-…
2013-04-08T18:50:45Z · 开源软件 · 评论(0)
php-model for emacs
下载php-model for emacs http://sourceforge.net/projects/php-mode/files/?source=navbar ace jump model 下载地址 https://github.com/winterTTr/ace-jump-mode linum-model.el 下载 http://web.student.tuwien.ac.at/~e0225855/linum/linum.html
2013-03-18T00:39:27Z · 开源软件 · 评论(0)
PHP 快速排序
<?php //Quick Sort function quickSort(array $array){ static $run = 0; $len = count($array); if($len <= 1) return $array; $arrleft=array(); $arrright=array(); $flag = $array[0]; for($i=1;$i<$len;$i++){ if($array[$i]<=$flag){ $arrleft[]=$array[$i]; }else{ $arrright[] = $array[$i]; } } $arrleft = quic…
2013-03-08T11:09:41Z · 编程语言 · 评论(0)
插入排序
<?php /** * InsertSort */ function insertSort($data){ $len=count($data); $list = array(); $list[0] = $data[0]; for($i=1;$i<$len;$i++){ $list_len = count($list); if($list[$list_len-1]<$data[$i]){ $list[]=$data[$i]; continue; } for($j=0; $j<$list_len; $j++){ if($data[$i] < $list[$j]){ for($t=$list_le…
2013-03-08T11:08:23Z · 编程语言 · 评论(0)
选择排序
选择排序 <?php /** * selectSort */ function selectionSort($data){ $len = count($data); for($i=0; $i<$len; $i++){ for($j=$i+1; $j<$len; $j++){ if($data[$i] > $data[$j]){ $t = $data[$i]; $data[$i]=$data[$j]; $data[$j]=$t; } } } return $data; } /** * Super select sort */ function superSelectionSort($data)…
2013-03-08T11:07:12Z · 编程语言 · 评论(0)
二维数组排序
二维数组排序 <?php function arr_sort($data){ $len = count($data); for($i=0;$i<$len;$i++){ $ilen = count($data[$i]); for($j=0;$j < $ilen;$j++){ $m = $data[$i][$j]; $mpos1 = $i; $mpos2 = $j; if( !isset($data[$i][$j+1]) ){ $ii = $i+1; $jj = 0; }else{ $ii = $i; $jj = $j+1; } for($ii; $ii<$len; $ii++){ $iilen…
2013-03-08T11:05:51Z · 编程语言 · 评论(0)
Magento 更新索引出问题解决方法
Magento 更新索引出现问题时候 There was a problem with reindexing process. SET FOREIGN_KEY_CHECKS=0; TRUNCATE TABLE catalog_product_flat_1; 删除/var/locks/下所有文件 重新刷新索引。
2013-02-25T17:28:03Z · 开源软件 · 评论(0)
Nodejs(4) - 事件
var EventEmitter = require('events').EventEmitter; var event = new EventEmitter(); //注册some event 事件 event.on('some_event',function(){ console.log('some event occured.'); }); setTimeout(function(){ //发送一个some_event 事件 event.emit('some_event'); },1000);
2013-01-08T20:23:46Z · 编程语言 · 评论(0)
如何让Centos支持中文
http://ftp.dc.volia.com/pub/CentOS/5.4/os/x86_64/CentOS/点击这个链接 将请确认你的版本号。 将5.4更改为你的CentOS版本即可 然后查找 fonts-chinese 然后就能找到你需要下载的rpm 包 复制链接然后 #rpm -ivh fonts-chinese-3.02-12.el5.noarch.rpm #vi /etc/sysconfig/i18n 将LANG="en_US.UTF-8" SYSFONT="latarcyrheb-sun16" 修改原内容为 LANG="zh_CN.GB18030" LANGUAGE="zh_C…
2012-12-25T16:52:21Z · 操作系统 · 评论(0)