上一页 1 ··· 3 4 5 6 7
摘要: <?php// 这个文件$filename = '1.jpg';$percent = 0.5;// 内容类型header('Content-Type: image/jpeg');// 获取新的尺寸list($width, $height) = getimagesize($filename);$new_width = $width * $percent;$new_height = $height * $percent;// 重新取样$image_p = imagecreatetruecolor($new_width, $new_height);$image 阅读全文
posted @ 2013-04-11 14:29 徐耀湘 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 对ecshop无限级分类的解析,认真分析后发现真的其算法还是比较精典的其实并不难理解,有举例方便大家理解function cat_options($spec_cat_id, $arr){ static $cat_options = array(); if (isset($cat_options[$spec_cat_id])) { return $cat_options[$spec_cat_id]; } /* 初始化关键参数: $level:当前子节点深度 $last_cat_id:当前父节点ID $options:带有缩进级别的数组 $cat_id_array:沿同一路径的父节点依次进驻 $l 阅读全文
posted @ 2013-03-26 10:10 徐耀湘 阅读(181) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>int main(){ using namespace std; int n; cout<<"Enter numbers in the range 1-10 to find "; cout<<"my favorite number\n"; do { cin>>n; }while(n!=7); cout<<"Yes,7 is my favorite.\n"; return 0;} 阅读全文
posted @ 2013-02-27 16:50 徐耀湘 阅读(151) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <cstring>using namespace std;int main(){ using namespace std; char word[5]="?ate"; for(char ch='a';strcmp(word,"mate");ch++) { cout<<word<<endl; word[0]=ch; } cout<<"After loop ends.word is "<<word& 阅读全文
posted @ 2013-02-27 15:21 徐耀湘 阅读(164) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <cstring>int main(){ using namespace std; cout<<"Enter a word: "; string word; cin>>word; char temp; int i,j; for(j=0,i=word.size()-1;j<i;--i,++j) { temp=word[i]; word[i]=word[j]; ... 阅读全文
posted @ 2013-02-27 11:23 徐耀湘 阅读(161) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>int main(){ using namespace std; cout<<"The Amazing Accounto will sum and average "; cout<<"five numbers for you.\n"; cout<<"Please enter five values:\n"; double number; double sum=0.0; for(int i=1;i<=5;i++) { ... 阅读全文
posted @ 2013-02-27 11:07 徐耀湘 阅读(2222) 评论(0) 推荐(0) 编辑
摘要: assume cs:code a segment db 1,2,3,4,5,6,7,8 a ends b segment db 1,2,3,4,5,6,7,8 b ends c segment db 0,0,0,0,0,0,0,0 c ends code segment start:mov... 阅读全文
posted @ 2012-12-23 16:25 徐耀湘 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 输入单元,存储器,运算器,控制器,输出单元 运算器中有一个算术逻辑运算单元,ALU.可以进行加减乘除和位运算等。不具备记忆功能。 运算器中有若干个临时存储数据的部件,成为寄存器,寄存器由触发器构成。寄存器还可保存运算的状态(是一个什么概念?) 在运算器中可以有多种不同的寄存器(??),在指定的一个寄存器时必须给每个寄存器指定一个编号,称为寄存器号。寄存器号用于二进制代码表示。算逻单元ALU所... 阅读全文
posted @ 2012-12-03 11:41 徐耀湘 阅读(1047) 评论(0) 推荐(0) 编辑
摘要: 十六进制 十进制 二进制 0 0 0000 1 1 0001 2 2 0010 3 3 0011 ... 阅读全文
posted @ 2012-11-07 11:08 徐耀湘 阅读(352) 评论(0) 推荐(0) 编辑
摘要: 324转换为二进制 324/2=162 余 0 162/2=81 余 0 81/2=40 余 1 40/2=20 余 0 20/2=10 余 0 10/2=5 余 0 5/2=2 余 1 2/2=1 余 0 1/2=0 余 1 由下而上排序 101000100 101000100转十进制 256 128 64 ... 阅读全文
posted @ 2012-11-06 10:29 徐耀湘 阅读(241) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7