上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 25 下一页

2013年6月5日

brasb 密码自动应答

摘要: 1 #!/bin/sh 2 #mypasswd时密码 3 mypasswd=..... 4 echo ${mypasswd} | sudo -S brasb > /dev/null 2>&1 5 if [ $? = 0 ] 6 then 7 echo "OK" 8 else 9 echo "Failed"10 fi 阅读全文

posted @ 2013-06-05 22:38 阿加 阅读(152) 评论(0) 推荐(0) 编辑

分析出动态库

摘要: 1 #! /bin/bash 2 LIB_CUR_REL= 3 LIB_CUR_ABS= 4 5 get_binary_dependency() 6 { 7 readelf -d $1 | grep NEEDED | sed -n 's,.*\[\(.*\)\],\1,p' 8 } 9 10 expand_path()11 {12 LIB_CUR_ABS=13 f... 阅读全文

posted @ 2013-06-05 22:34 阿加 阅读(145) 评论(0) 推荐(0) 编辑

toryoma服务器到本地传输

摘要: 1 #! /bin/bash 2 3 name=liuchangcheng 4 5 loginme() 6 { 7 last | grep `w -u $1 | awk 'NR == 3{print $1}'` | grep 'still logged in' | awk '{print $1 ,$3}' | sort -k 2 -d | uniq > /tmp/login${... 阅读全文

posted @ 2013-06-05 22:32 阿加 阅读(178) 评论(0) 推荐(0) 编辑

dostolinux and linuxtodos

摘要: dostolinux1 #! /bin/sh 2 sed -e 's/.$//' $1>$2linuxtodos1 #! /bin/sh 2 sed -e 's/$/\r/' $1>$... 阅读全文

posted @ 2013-06-05 22:30 阿加 阅读(322) 评论(0) 推荐(0) 编辑

观察者模式

摘要: 引述自CSDN 刘伟技术博客http://blog.csdn.net/LoveLion 1 #include 2 #include 3 using namespace std; 4 5 class AllyControlCenter; 6 //抽象观察类 7 class Observ... 阅读全文

posted @ 2013-06-05 21:45 阿加 阅读(167) 评论(0) 推荐(0) 编辑

2013年5月30日

constructor the shared structure in-place

摘要: new(mCblk) audio_track_cblk_t(); placement new 1 #include <iostream> 2 #include <stdio.h> 3 #include <malloc.h> 4 5 class Student 6 { 7 private: 8 int age; 9 int grade;10 public:11 Student(void)12 {13 age = 5;14 grade = 10;15 }... 阅读全文

posted @ 2013-05-30 15:23 阿加 阅读(177) 评论(0) 推荐(0) 编辑

2013年5月26日

C 实现 C++继承多态 实例

摘要: 引述自:http://www.eventhelix.com/realtimemantra/basics/ComparingCPPAndCPerformance2.htm#.UaG1Kdd3-fg 1 // A typical example of inheritance and virtual function use. 2 // We would be mapping this code to equivalent C. 3 4 // Prototype graphics library function to draw a circle 5 vo... 阅读全文

posted @ 2013-05-26 15:11 阿加 阅读(1029) 评论(0) 推荐(1) 编辑

2013年5月24日

printf

摘要: 1 转换说明符及作为结果的打印输出 2 ------------------+------------------------------------------------ 3 转换说明 + 输出 4 ------------------+------------------------------------------------ 5 %c + ... 阅读全文

posted @ 2013-05-24 14:01 阿加 阅读(227) 评论(0) 推荐(0) 编辑

2013年5月21日

shell 加法

摘要: i=$i+1是在i的变量值后加上字符串'+1'总结:其他语言中的$i++操作在shell中表示如下:#!/bin/bashn=1;echo -n "$n "let "n = $n + 1"echo -n "$n ": $((n = $n + 1))echo -n "$n "(( n = n +1 ))echo -n "$n ": $[ n = $n +1 ]echo -n "$n "n=$[ $n + 1 ]echo -n "$n "let 阅读全文

posted @ 2013-05-21 18:43 阿加 阅读(2628) 评论(0) 推荐(0) 编辑

2013年5月16日

两个散列函数

摘要: 除法散列法:散列函数:h(k) = k mod m;关键字为k,m是散列数组的长度m不应是2的幂,当k是一个按基数2^p解释的字符串时,选m=2^p-1可能是一个比较糟糕的选择可以选做m的值常常是与2的整数幂不太接近的质数. 乘法散列法:例子:k = 123456, p = 14, m = 2^14 = 16384,因为当s/(2^32)与(sqrt(5) - 1)/2接近时,s为2654435,故(k*s)&(~0) = 17612864,取其高14位,得散列值67 阅读全文

posted @ 2013-05-16 09:51 阿加 阅读(262) 评论(0) 推荐(0) 编辑

上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 25 下一页

导航