Iccavr C语言例子程序源程序

第十章IccAVR C语言的应用,本章例子程序编号为对应第九章IARAVR C语言的例子程序编号, 这些例子程序硬件接口见<<第九章IARAVR C语言的应用>>;第十章编号10.5.1-9为新增例子程序,这些例子程序均在SL-AVR开发实验器上验证通过

广州天河双龙电子有限公司https://www.360docs.net/doc/7317427949.html,

 for (;;) /* 死循环 */ 

{ 

if (runner) runner <<= 1; 

else runner = 0x01; 

PORTB = runner; 

delay(32767); 

} 

} 

 

 

//第十章例子10.3.3 读/写EEPROM

// These work for devices with more than 256 bytes of EEPROM 

//int EEPROMwrite( int location, unsigned char); 

//unsigned char EEPROMread( int); 

#include <io8515.h> 

#include <eeprom.h> 

void main(void) 

{ 

unsigned char temp =0xaa,i; 

EEPROMwrite(0x20,temp); /* 写E2PROM 地址0x20 */ 

i=EEPROMread(0x20); /* 读E2PROM 地址 0x20 */ 

i++; 

 EEPROMwrite(0x30,i); 

 

 

//第十章例子10.3.4 AVR的PB口变速移位 

#include <io8515.h>

#define BIT(x) (1<<(x))

广州天河双龙电子有限公司https://www.360docs.net/doc/7317427949.html,

void delay(void) 

{ 

 unsigned char i,j; 

for (i=1;i;i++) 

for(j=1;j;j++); 

} 

void led_pb(void) 

{ 

 unsigned char i; 

 DDRB=0xff; 

 for (i=0;i<8;i++) 

{ 

PORTB= ̄BIT(i); 

delay(); 

} 

} 

void main (void) 

{ 

while (1) 

led_pb(); 

} 

 

 

//第十章例子10.3.5 4个口LED亮灯变速移位 

#include <io8515.h>

#define BIT(x) (1<<(x))

void delay(unsigned char delayValue) 

{ 

 unsigned char i,j; 

广州天河双龙电子有限公司https://www.360docs.net/doc/7317427949.html,

for(i=0;i<delayValue;i++) 

for (j=1;j;j++) 

; 

} 

void led_pb(unsigned char t)

{ 

 unsigned char i; 

 DDRB=0xff;

 for (i=0;i<8;i++)

{ 

PORTB= ̄BIT(i);

delay(t);

} 

 PORTB=0xff;

} 

void led_pd(unsigned char t)

{ 

 unsigned char i; 

 DDRD=0xff; 

 for (i=0;i<8;i++)

{ 

PORTD= ̄BIT(i); 

delay(t); 

} 

 PORTD=0xff; 

} 

void led_pc(unsigned char t)

{ 

 unsigned char i; 

广州天河双龙电子有限公司https://www.360docs.net/doc/7317427949.html,

 DDRC=0xff; 

 for (i=0;i<8;i++)

{ 

PORTC= ̄BIT(i); 

delay(t); 

} 

 PORTC=0xff; 

} 

void led_pa(unsigned char t)

{ 

 unsigned char i; 

 DDRA=0xff; 

 for (i=8;i>0;i--)

{ 

PORTA= ̄BIT(i-1); 

delay(t); 

} 

 PORTA=0xff; 

} 

void main (void)

{ 

 unsigned char dt; 

 while (1)

{ 

for (dt=5;dt<200;dt+=25) 

{ 

led_pb(dt);

led_pd(dt); 

led_pc(dt); 

广州天河双龙电子有限公司https://www.360docs.net/doc/7317427949.html,

led_pa(dt); 

} 

} 

} 

 

 

//第十章例子10.3.6 音符声程序 

#include <io8515.h> /*预处理命令 */ 

#define uchar unsigned char 

#define uint unsigned int 

void delay(uchar t) 

{ 

 uchar i,j; 

for (i=0;i<t;i++) 

for(j=1;j<150;j++); 

} 

void sound_pc0(uchar t) 

{ 

 uint i; 

 DDRC=0xff; 

 PORTC=0xff; 

 for (i=0;i<350-t*t;i++)

{ 

PORTC^=0x01; 

delay(t); 

} 

} 

void main (void)

{ 

广州天河双龙电子有限公司https://www.360docs.net/doc/7317427949.html,

 uchar dt; 

 for(;;) 

{ 

for(dt=1;dt<14;dt++)

sound_pc0(dt); 

} 

 

 

//第十章例子10.3.7 8字循环移位显示程序 

#include <io8515.h>

#define uchar unsigned char

#define uint unsigned int 

void delay(uint t) 

{ 

 uint i; 

 for (i=0;i<t;i++) 

; 

} 

void init_disp(void)

{ 

DDRB=0xff; 

DDRD=0xff; 

PORTB=0x7f;

} 

void scan(void)

{ 

 uchar i,j; 

 for (i=0;i<6;i++)

广州天河双龙电子有限公司https://www.360docs.net/doc/7317427949.html,

{ 

j=150; 

do 

{ 

PORTD= ̄(0x01<<i); 

delay(150);

PORTD=0xff; 

delay(2100);

} 

while(--j); 

} 

} 

void main(void)

{ 

 init_disp();

 for(;;) 

 scan();

} 

 

//第十章例子10.3.8 按键加计数显示程序 

#include <io8515.h>

#define uchar unsigned char

#define uint unsigned int 

const uchar DATA_7SEG[ ] ={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07, 

0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};/*LED 字形表*/ uchar led[6] ;

uint count; 

void delay(uint t)

{ 

广州天河双龙电子有限公司https://www.360docs.net/doc/7317427949.html,

 uint i; 

 for (i=0;i<t;i++) 

; 

} 

void init_disp(void)

{ 

 DDRB=0xff; 

 DDRD=0x7f; 

 PORTD|=0x80; 

void disp(void)

{ 

 uchar i; 

 for (i=0;i<6;i++) 

{ 

PORTD= ̄(0x01<<i); 

PORTB=DATA_7SEG[led[i]]; 

delay(1000); 

} 

PORTB=0x00; 

PORTD=0xff; 

} 

void be_pc0(void)

{ 

 uint i; 

 DDRC|=0x01; 

 for (i=0;i<350;i++) 

{ 

PORTC^=0x01; 

广州天河双龙电子有限公司https://www.360docs.net/doc/7317427949.html,

delay(350); 

} 

} 

void conv(void)

{ 

led[5] =0; 

led[4] =count/10000; 

led[3] =count/1000%10; 

led[2] =count/100%10; 

led[1] =count/10%10; 

led[0] =count%10; 

} 

void main(void)

{ 

 init_disp();

 count=0;

 conv();

 for(;;) 

{ 

while((PIND&0x80)==0x80)

disp();

be_pc0();

count++;

conv();

while((PIND&0x80)==0)

disp();

} 

 

} 

广州天河双龙电子有限公司https://www.360docs.net/doc/7317427949.html,

 

 

//第十章例子10.4.1 锯齿波程序 

#include <io8515.h>

#define uchar unsigned char 

void delay(void)

{ 

} 

void main(void)

{ 

 uchar c; 

 DDRA=0xff;

 for (;;) 

{ 

PORTA=c++;

delay(); 

 

 

//第十章例子10.4.2 正三角波程序 

#include <io8515.h>

#include <math.h>

#define uchar unsigned char 

#define uint unsigned int 

void delay(void)

{ 

} 

void main(void)

广州天河双龙电子有限公司https://www.360docs.net/doc/7317427949.html,

{ 

 uchar c; 

 DDRA=0xff;

 for (;;) 

{ 

for (c=0x00;c<0xff;c++)

{ 

PORTA=c;

delay(); 

for (c=0xff;c>0x00;c--)

{ 

PORTA=c;

delay(); 

} 

} 

 

 

//第十章例子10.4.3 梯形波程序 

#include <io8515.h>

#define uchar unsigned char 

#define uint unsigned int 

void delay(uchar t)

{ 

 uchar i; 

 for (i=0;i<t;i++) 

; 

} 

广州天河双龙电子有限公司https://www.360docs.net/doc/7317427949.html,

void main(void)

{ 

 uchar c; 

 DDRA=0xff;

 for (;;) 

{ 

for (c=0x00;c<0xff;c++)

PORTA=c;

delay(255);

for (c=0xff;c>0x00;c--)

PORTA=c;

delay(255);

} 

 

 

//第十章例子10.4.4 正弦波程序 

#include <io8515.h>

#define uchar unsigned char 

#define uint unsigned int 

const uchar sintab[ ] =

{ 

128,130,132,135,137,139,141,143,146,148, 

150,152,154,157,159,161,163,165,167,169, 

171,174,176,178,180,182,184,186,188,190, 

191,193,195,197,199,201,203,204,206,208, 

210,211,213,215,216,218,219,221,222,224, 

225,227,228,229,231,232,233,235,236,237, 

广州天河双龙电子有限公司https://www.360docs.net/doc/7317427949.html,

238,239,240,241,242,243,244,245,246,247, 

247,248,249,249,250,251,251,252,252,253, 

253,253,254,254,254,255,255,255,255,255, 

255,255,255,255,255,255,254,254,254,253, 

253,253,252,252,251,251,250,249,249,248, 

247,247,246,245,244,243,242,241,240,239, 

238,237,236,235,233,232,231,229,228,227, 

225,224,222,221,219,218,216,215,213,211, 

210,208,206,204,203,201,199,197,195,193, 

192,190,188,186,184,182,180,178,176,174, 

171,169,167,165,163,161,159,157,154,152, 

150,148,146,143,141,139,137,135,132,130, 

128,126,124,121,119,117,115,113,110,108, 

106,104,102, 99, 97, 95, 93, 91, 89, 87, 

 85, 82, 80, 78, 76, 74, 72, 70, 68, 66, 

 65, 63, 61, 59, 57, 55, 53, 52, 50, 48, 

 46, 45, 43, 41, 40, 38, 37, 35, 34, 32, 

 31, 29, 28, 27, 25, 24, 23, 21, 20, 19, 

 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 

9, 8, 7, 7, 6, 5, 5, 4, 4, 3, 

3, 3, 2, 2, 2, 1, 1, 1, 1, 1, 

1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 

3, 3, 4, 4, 5, 5, 6, 7, 7, 8, 

9, 9, 10, 11, 12, 13, 14, 15, 16, 17, 

 18, 19, 20, 21, 23, 24, 25, 27, 28, 29, 

 31, 32, 34, 35, 37, 38, 40, 41, 43, 45, 

 46, 48, 50, 52, 53, 55, 57, 59, 61, 63, 

 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 

 85, 87, 89, 91, 93, 95, 97, 99,102,104, 

广州天河双龙电子有限公司https://www.360docs.net/doc/7317427949.html,

106,108,110,113,115,117,119,121,124,126, 

}; 

void main(void) 

{ 

 uint i; 

 DDRA=0xff; 

 for (;;) 

{ 

for (i=0;i<360;i++) 

PORTA=sintab[ i] ; 

} 

} 

 

 

//第十章例子10.4.5 方波程序 

#include <io8515.h> 

#define uchar unsigned char 

#define uint unsigned int 

void delay(uchar t) 

{ 

 uchar i,j; 

 for (i=0;i<t;i++) 

for (j=1;j;j++) 

; 

} 

void main(void)

{ 

 DDRA=0xff;

 PORTA=0xff; 

广州天河双龙电子有限公司https://www.360docs.net/doc/7317427949.html,

 for(;;) 

{ 

PORTA^=0x01;

delay(25); 

} 

 

用双龙电子增补IccAVR库文件后新增例子 

双龙电子在IccAVR C高级语言中增加了库文件libslavr.a, 头文件slavr.h 

有关使用注意事项如下

在使用例子程序之前

将头文件slavr.h拷贝到头文件目录即...\include\目录如果想使用库文件中的函数 

1) 

2)使用附加的libslavr.a 库文件引号不需要输入) 

1)

可直接使用控制命令对LCD模块操作

data:命令或数据字节 ,data_type1表示数据

2)

0表示读取地址

void lcd_init(void); 

LCD模块初始化 

4)

void lcd_puts(unsigned char *s); 

广州天河双龙电子有限公司https://www.360docs.net/doc/7317427949.html,

字符串输出函数 

6)

void lcd_write(unsigned char adder,unsigned char data); 

写数据到指定DDRAM/CGRAM位置

8)

unsigned char lcd_read(unsigned char adder); 

从指定DDRAM/CGRAM位置读取数据

10)

void lcd_shift(unsigned char n,unsigned char p);

LCD字符移位函数,n:移动的次数,p:移动方向,'l'或'L'表示左移void delay_1ms(void); 

13)

unsigned char scan_key(void); 

键盘扫描函数,注意本函数不作按键释放检查

返回值没有键按下返回0x7f 

2返回值最高位为1 

3返回键名对应数值 

15)

如果shift按下

其余键按下时

void Start(void);

I2C总线启动 

17)

广州天河双龙电子有限公司https://www.360docs.net/doc/7317427949.html,

I2C总线停止 

18)

void NoAck(void); 

发送非应答信号 

20)

有应答信号返回0 

21)

unsigned char Read8Bit(void); 

从I2C总线读取一个字节数据 

23)

unsigned char *Wdata 

EEPROM中的目标地址 

unsigned char number

void Read24c02(unsigned char *RamAddress,unsigned char RomAddress,unsigned char bytes); 对串行EEPROM存贮器AT24C02连续读多个字节 

参数说明指向存放读出数据的变量的指针 

unsigned char RomAddress

连续读的字节数 

LED ICCAVR中的典型例子

interrupt 使用定时器1溢出中断的例子 

10.5.4)

keyboard1.c和keyboard2.c 

10.5.5) 使用keypad函数

keyboard1.c观察其对LED显示有何影响 

10.5.5B) 使用keypad函数

广州天河双龙电子有限公司https://www.360docs.net/doc/7317427949.html,

10.5.6)

clock 电脑时钟程序----24小时制时钟 

10.5.8)测量范围0-999999 HZ 

I2C AVR单片机使用I2C总线的例子包含两个例子 

10.5.9)从中可以学习I2C总线的工作过程 

10.5.9A) 可以连续多字节读写

a其中有关函数原型说明参考头文件slavr.h

上述例子程序的硬件接线如果没特殊说明

 

 

//第十章例子10.5.1)可作为ICCAVR的起步 

/********************************************** 

http://www.sl.com.cn 

双龙电子公司(ICCAVR)

**********************************************/ 

#include <io8515.h> 

/**********************************************************

为了可以看见LED的图案变化

广州天河双龙电子有限公司https://www.360docs.net/doc/7317427949.html,

 

void LED_On(int i) 

 { 

 PORTB= ̄(1<<i); /* 输出低电平

广州天河双龙电子有限公司https://www.360docs.net/doc/7317427949.html,

软件著作权源代码例子

1 2 #ifnfdgdfdef __CHEDGDFGCLID_A_ 3 #dedfgdffine __CHEGDFGCLID_A_ 4 5 /************************************************************************/ 6 /* 定义 */ 7 /************************************************************************/ 8 #defgdfgdfine FLADGDFGSH_SEDGDFGION 9 10 #defidgdne EDFGDFNS_ ADDGDFDESS_TEST #defidgdfne EDGDFGNS_ ADDEDGDGSS_TEST_3 11 12 13 #defdgdfine NDGDFGEED _CHECK 6 14 15 typdfgdfedef enum { 16 17 CA_ONEISDGDFGEMPTY, 18 CA_TWOISEDGDFGMPTY, 19 CA_TWOISFFDGDFGULL 20 }chedgdfckusdfdfm; 21 22 typedsfsdfef ssfsdftruct 23 { 24 TX_U8 desfdfsKey[9]; 25 TX_U8 desfsdfdsresult[9]; 26 TX_U64 crc64; 27 }DedgdfgsDatsfsdfdsa_f; 28 /************************************************************************/ 29 30 /* 函数声明 */ 31 /************************************************************************/ 32 TX_ ChesfsfckValid(checkenum checkcase); 33 TX_ ResfsdfadFlash(void); 34 TX_ ReadRanFromPanel(void); 35 TX_ ResfsdfadSerial(void); 36 TX_ ResfsdfadIPanel(void);

VISUAL BASIC实例源代码

课前体验 Private Sub Form_Click() For i=1To10 For j=1To i Print"*"; Next j Print Next i End Sub 【例3-1】 Private Sub Form_Click() c1$=Chr$(13)+Chr$(10) msg1$="请输入您的名字:" msg2$="输入后按回车键" msg3$="或单击“确定”按钮" msg$=msg1$+c1$+msg2$+c1$+msg3$ name$=InputBox(msg$,"InputBox函数示例","张三") Print name$ End Sub 【例3-2】 Private Sub Form_Click() Msg1$=”Are you Continue to?” msg2$=”Operation Dialog Box” r=MsgBox(msg1$,34,msg2$) Print r End Sub 【例3-3】编写程序,用MsgBox函数判断是否继续执行。 Private Sub Form_Click() msg$="请确认此数据是否正确" Title$="数据检查对话框" x=MsgBox(msg$,19,Title$) If x=6Then Print x*x ElseIf x=7Then Print"请重新输入" End If End Sub 【例3-5】

Private Sub Form_Click() Print:Print FontName="隶书" FontSize=16 Print"姓名";Tab(8);"年龄";Tab(16);"职务"; Print Tab(24);"单位";Tab(32);"籍贯" Print Print"吴大明";Tab(8);25;Tab(16);"职员";Tab(24);"人事科"; Tab(32);"北京" End Sub 【例3-6】 Private Sub Form_Click() X=InputBox("请输入成绩","学生成绩录入","00") Print x End Sub 【例3-7】 Private Sub Form_Click() Dim x As Single,y As Single x=InputBox(“请输入x的值”) If x>0Then y=1ElseIf x=0Then y=0Else y=-1 Print“x=”;x,”y=”;y End Sub 【例3-8】 Private Sub Form_Click() Dim msg,UserInput msg="请输入一个字母或0~9之间的数字." UserInput=InputBox(msg)‘输入一个字母或数字If Not IsNumeric(UserInput)Then‘判断是否是数字 If Len(UserInput)=1Then‘不是数字时,判断输入的字符串长度是否为1 Select Case Asc(UserInput)‘判断输入字母的ASCII 码值 Case60To90'在60-90之间为大写字母 msg="你输入的是一个大写字母'" msg=msg&Chr(Asc(UserInput))&"'。" Case97To122'小写字母

matlab源代码实例

1.硬币模拟试验 源代码: clear; clc; head_count=0; p1_hist= [0]; p2_hist= [0]; n = 1000; p1 = 0.3; p2=0.03; head = figure(1); rand('seed',sum(100*clock)); fori = 1:n tmp = rand(1); if(tmp<= p1) head_count = head_count + 1; end p1_hist (i) = head_count /i; end figure(head); subplot(2,1,1); plot(p1_hist); grid on; hold on; xlabel('重复试验次数'); ylabel('正面向上的比率'); title('p=0.3试验次数N与正面向上比率的函数图'); head_count=0; fori = 1:n tmp = rand(1); if(tmp<= p2) head_count = head_count + 1; end p2_hist (i) = head_count /i; end figure(head); subplot(2,1,2); plot(p2_hist); grid on; hold on; xlabel('重复试验次数'); ylabel('正面向上的比率'); title('p=0.03试验次数N与正面向上比率的函数图'); 实验结果:

2.不同次数的随机试验均值方差比较 源代码: clear ; clc; close; rand('seed',sum(100*clock)); Titles = ['n=5时' 'n=20时' 'n=25时' 'n=50时' 'n=100时']; Titlestr = cellstr(Titles); X_n_bar=[0]; %the samples of the X_n_bar X_n=[0]; %the samples of X_n N=[5,10,25,50,100]; j=1; num_X_n = 100; num_X_n_bar = 100; h_X_n_bar = figure(1);

软件著作权成功维权十大案例之一

软件著作权成功维权十 大案例之一 公司内部编号:(GOOD-TMMT-MMUT-UUPTY-UUYY-DTTI-

2015软件着作权成功维权十大案例之一 临危受命,严密证据链让被告无处可逃 导读:一场历时一年多的“图像预处理”软件着作权之争终于在2015年09月17日下午谢幕。在本案一审审理中,在极为不利的情况下,长昊律师事务所临危受命、不负重望,最终喜得佳绩。我所律师以当事人的合法利益最大化为目标,在案件亲办过程中,克服重重困难,终于让被告受到了法律的制裁。本所回顾此案办理历程并就案件核心予以展述,一起共勉。 软件被盗,果断维权 2012年7月20日,张XX、陈XX将其共同享有的《XXX软件》(以下简称涉案侵权软件)转让给XH公司,并签订了《计算机软件着作权转让协议》。2012年12月1日,国家版权局出具证书号为软着登字第XX 号的《计算机软件着作权登记证书》,证书记载:着作权人为XH公司,开发完成日期为2009年9月9日,权利取得方式为受让,权利范围为全部权利。 被告人李XX注册成立深圳市HCRZ科技有限公司(以下简称HCRZ公司),在宝安区西乡黄田草围第一工业区租赁厂地生产摄像头,并未经原告XH公司授权在其生产的摄像头上安装XH公司所有的涉案侵权软件。 2014年05月30日10时,XH公司代表张XX向公安机关举报被告人李XX所有的HCRZ公司生产的摄像头软件侵犯其公司研发的软件着作权,2014年8月13日,公安机关在位于深圳市宝安区西乡黄田草围第一工业区HCRZ公司查获各类型摄像头5000多个,其中安装了涉案侵权软件的的HD-500T摄像头477个,查获电脑、烧录器等工具,并将被告人

c实例源代码

【实例1-1】 using System; using System、Collections、Generic; using System、Text; namespace _ { class Program { static void Main(string[] args) { System、Console、Wriine("恭喜您,学会了C#编程!"); System、Console、ReadLine(); } } } 【实例1-2】 private void Form1_Load(object sender, EventArgs e) { this、Text="这就是一窗口!"; Label lbShow = new Label(); lbShow、Location = new Point(40,50); lbShow、AutoSize = true; lbShow、Text = "恭喜您学会编程了!"; this、Controls、Add(lbShow); int[] x, y; x = new int[5] { 1,2,3,4,5}; y = new int[5]; y = x; foreach (int a in y) { lbShow、Text += a、ToString(); } this、Controls、Add(lbShow); } 【实例2-1】 using System; using System、Windows、Forms; namespace TestEnum { public partial class TestEnum : Form { //Visual Studio 、Net自动生成得构造函数,后文示例将全部省略 public TestEnum() { Initializeponent(); } enum MyEnum { a = 101, b, c, d = 201, e, f }; //声明枚举型 private void TestEnum_Load(object sender, EventArgs e) { MyEnum x = MyEnum、f; //使用枚举型 MyEnum y = (MyEnum)202; string result ="枚举数x得值为"; result += (int)x; //将x转换为整数 result += "\n枚举数y代表枚举元素" + y; lblShow、Text = result; } }

软件著作权-源代码范本

软件著作权-源代码范本 注意事项:常见的源代码包含:C语言,VB,C++,JAVA,.NET等。 提交的代码必须是源代码的开头载入程序,第30页必须断开,第60页是软 件的程序结尾,代码中不得出现与申请表内容不符合的日期,著作权人,软件名 字等,不能出现开源代码,不能出现任何版权纠纷。 格式要求:一、源代码应提交前、后各连续30页,不足60页的,应当全部提交。 、源代码页眉应标注软件的名称和版本号,应当与申请表中名称完全一致,页 眉右上应标注页码,源代码每页不少于50行。 范例如下: #i nclude #in elude #i nclude #in elude

#in elude #i nclude #i nclude #i nclude #i nclude #in clude #in clude #in clude #in clude #in clude #in clude #in clude #in clude #in clude #in clude #defi ne NS_MAIN 1 #i nclude #en dif #ifdef DLZ #in clude #en dif static tybs_boolean_t wan t_stats = TYBS_FALSE; static char static char static char static char static un sig ned program_ name[TYBS_DIR_NAMEMAX] = "n amed"; absolute_co nffile[TYBS_DIR_PATHMAX]; saved_comma nd_li ne[512]; versio n[512]; maxsocks = 0; n s_ma in _earlywar nin g(c onst char *format, ...) { va_list args; va_start(args, format); if (ns_g」ctx != NULL) { tybs_log_vwrite( ns_g」ctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_W ARNING, format, args); } else { fprin tf(stderr, "%s: ", program_ name); vfprin tf(stderr, format, args); fprin tf(stderr, "\n"); fflush(stderr); } va_e nd(args); } Void n s_ma in _earlyfatal(c onst char *format, ...) { va_list args; va_start(args, format); if (ns_g」ctx != NULL) { tybs_log_vwrite( ns_g」ctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_CRITICAL, format, args); tybs_log_write( ns_g」ctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_CRITICAL, "exit ing (due to early fatal error)"); } else { fprin tf(stderr, "%s: ", program, name); vfprin tf(stderr, format, args); fprin tf(stderr, "\n"); fflush(stderr); } va_e nd(args); exit(1); } static void assert ion _failed(c onst char *file, in t li ne, tybs_assert ion type_t type, const char *cond)

HTML语言源代码实例.

HTML语言源代码实例1.第一个HTML示例 第一个HTML示例 HTML的基本结构。 2.换行标签
测试换行标签 天津公安警官职业学院
电教中心
授课教师李平

3.强制不换行标签 测试强制不换行标签 黄鹤楼

昔人已乘黄鹤去,此地空余黄鹤楼。 黄鹤一去不复返,白云千载空悠悠晴川历历汉阳树,芳草萋萋鹦鹉洲。日暮乡关何处是? 烟波江上使人愁。 4.自动换行标签

测试自动换行标签 风中,花儿谢了

凄怜的娇花在悲凉的秋风中,从曾经绚烂娇媚的枝梢, 轻曼着彩蝶般的舞姿,漫天飞洒,一片片无奈地落在那冰冷森寒的风刃之上。 于是,万千飞舞的蝶便化成纷扬的花絮,轻盈地随风而起, 又随风飘得很远、很远。 5.分段控制标签 测试分段控制标签 花儿什么也没有。它们只有凋谢在风中的轻微、 凄楚而又无奈的吟怨,就像那受到了致命伤害的秋雁,

著作权案例分析

案例一:“脸谱”引发著作权纠纷 中国艺术研究院赔偿4万 案情介绍: 《中国戏曲脸谱》一书使用了京剧脸谱绘画大师汪鑫福所绘的177幅京剧脸谱,汪鑫福的外孙季成将中国艺术研究院、九州出版社、北京世纪高教书店诉至法院。 汪鑫福自上世纪20年代起至90年代去世时陆 续创作了大量京剧脸谱,相当部分都收藏在艺术研究院陈列室中。上世纪50年代时,汪鑫福曾在艺术研究院前身戏曲改进局工作。2000年1月,经北京森淼圆文化传播有限公司组织联系,由艺术研究院提供图片及文字,九州出版社提供书号出版了中国戏曲脸谱》一书,该书中使用了汪鑫福绘制并收藏在陈列室中的177幅京剧脸谱,但没有为汪鑫福署名。 季成作为汪鑫福的外孙,自其母亲去世后即为“脸谱”的继承人。季成于2010年初发现《中国戏曲脸谱》一书,并于2010年8月从北京世纪高教书店购买到该书,故起诉要求 三被告停止侵权、向其赔礼道歉、赔偿经济损失53.1万元、精神损害抚慰金1万元及合理费用3万余元等。 法院审理 诉讼中,双方争议焦点主要集中在涉案脸谱的性质上,季成表示涉案脸谱为汪鑫福个人作品,而艺术研究院坚持认为涉案脸谱完成于上世纪50年代,为著作权归属于该研究院的职务作品。法院经审理认为,双方均认可汪鑫福一生绘制了大量京剧脸谱,而涉案脸谱没有专门标识或特征体现出绘制时间,故无证据证明涉案脸谱的时间完成时间。不排除部分涉案脸谱完成时我国尚未颁布实施著作权法,但汪鑫福去世以及《中国戏曲脸谱》一书出版时,我国已于1991年6月1日起施行著作权法,那么在使用他人作品时,就应当尊重法律规定的赋予著作权人的权利,除非有合法理由排除或限制著作权人权利。 我国著作权法规定了两类职务作品,一类是著作权由作者享有,但单位有权在其业务范围内优先使用,另一类是作者享有署名权,著作权的其他权利由单位享有。艺术研究院既表示涉案脸谱属于第二类职务作品,又表示著作权应当全部归属于艺术研究院。法院根据本案证据体现出的情况,认为汪鑫福所绘制的京剧脸谱不属于艺术研究院主张的主要利用了单位的物质技术条件创作,并由单位承担责任的第二类职务作品。况且,艺术研究院曾书面承认其享有涉案脸谱的所有权,汪鑫福的家属享有著作权。涉案脸谱属于美术作品,原件所有权的转移不视为作品著作权的转移。艺术研究院的矛盾解释混淆了作品原件所有权人与著 作权人所享有权利的区别,美术作品原件所有权人在享有作品原件所有权的同时,享有该作品著作权中的展览权,但不享有该作品的其他著作权,也不得损害著作权人所享有的其他著作权。 法院判决 艺术研究院未经季成许可亦未支付报酬,将涉案脸谱收录入《中国戏曲脸谱》中,九州出版社未尽到著作权审查义务出版《中国戏曲脸谱》一书的行为侵犯了季成因继承而取得的涉案脸谱的复制权等著作财产权。北京世纪书店销售的《中国戏曲脸谱》一书有合法来源,应当承担停止销售的责任。最后,北京海淀法院判决三被告停止侵权、中国艺术研究院和九州出版社赔偿季成经济损失35400元及合理费用1万元。宣判后,双方当事人均未明确表示是

软件著作权申请源程序

**汽车商城管理系统源程序 using System; using System.Collections.Generic; using System.Text; namespace Qing.Model { ///

/// 购物车实体类 /// [Serializable] public partial class cart_keys { public cart_keys() { } #region Model private int _article_id; private int _quantity = 0; /// /// 文章ID /// public int article_id { set { _article_id = value; } get { return _article_id; } } /// /// 购买数量 /// public int quantity { set { _quantity = value; } get { return _quantity; } } #endregion } /// /// 购物车列表 /// [Serializable] public partial class cart_items { public cart_items(){ }

#region Model private int _article_id; private string _goods_no = string.Empty; private string _title = string.Empty; private string _spec_text = string.Empty; private string _img_url = string.Empty; private decimal _sell_price = 0M; private decimal _user_price = 0M; private int _quantity = 1; private int _stock_quantity = 0; ///

/// 文章ID /// public int id { set { _article_id = value; } get { return _article_id; } } /// /// 商品货号 /// public string goods_no { set { _goods_no = value; } get { return _goods_no; } } /// /// 商品名称 /// public string title { set { _title = value; } get { return _title; } } /// /// 商品地址 /// public string linkurl { get; set; } /// /// 商品规格 /// public string spec_text { set { _spec_text = value; }

java2实用教程(第3版例子代码)

Java 2实用教程(第三版) 清华大学出版社 (编著耿祥义张跃平) 例子源代码 建议使用文档结构图 (选择Word菜单→视图→文档结构图)

第一章Java 语言入门例子1 public class Hello { public static void main (String args[ ]) { System.out.println("你好,很高兴学习Java"); } } 例子2 public class People { int height; String ear; void speak(String s) { System.out.println(s); } } class A { public static void main(String args[]) { People zhubajie; zhubajie=new People(); zhubajie.height=170; zhubajie.ear="两只大耳朵"; System.out.println("身高:"+zhubajie.height); System.out.println(zhubajie.ear); zhubajie.speak("师傅,咱们别去西天了,改去月宫吧"); } } 例子3 import java.applet.*; import java.awt.*; public class Boy extends Applet { public void paint(Graphics g) { g.setColor(Color.red); g.drawString("我一边喝着咖啡,一边学Java呢",5,30); g.setColor(Color.blue);

软著源代码范例XJ

Main.c(代码处:在不少于每页50行的情况下,提供整个软件代码的开头30页和结尾30页) #include #include #include #include "netinet/in.h" #include "arpa/inet.h" #include #include #include #include #include #include #include #include #include "acct_counter.h" #include "nic_common.h" #include "nic_cfgmsg.h" #include "nic_meter.h" #include "nic_vmu.h" #include "nic_ipcmsg.h" #include "nic_aclmsg.h" #include "nic_lisa.h" #include "acl_ipv6_socket.h" #include "process_command.h" #define ACL_SOCKET_NUM 4 #define ACL_SOCKET_VALID 1 #define ACL_SOCKET_INVALID 0 #define NIC_IPC_MSG_BUFF_SIZE 2000 #define MAX_ACL_RULE 2000 intg_fd = -1; char *cmd_name = NULL; typedefstruct acl_ipv6_socket { uint8_t valid; uint8_t nic_id; intacl_socket; char *ifname; } acl_ipv6_socket_t; acl_ipv6_socket_t g_acl_ipv6_sockets[ACL_SOCKET_NUM] = { {ACL_SOCKET_INVALID, 0, 0, "nic0"}, {ACL_SOCKET_INVALID, 1, 0, "nic1"}, {ACL_SOCKET_INVALID, 2, 0, "nic2"},

软件著作权源代码

#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define NS_MAIN 1 #include #endif #ifdef DLZ #include #endif static tybs_boolean_t want_stats = TYBS_FALSE; static char program_name[TYBS_DIR_NAMEMAX] = "named"; static char absolute_conffile[TYBS_DIR_PATHMAX]; static char saved_command_line[512]; static char version[512]; static unsigned int maxsocks = 0; void ns_main_earlywarning(const char *format, ...) { va_list args; va_start(args, format); if (ns_g_lctx != NULL) { tybs_log_vwrite(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_W ARNING, format, args); } else { fprintf(stderr, "%s: ", program_name); vfprintf(stderr, format, args); fprintf(stderr, "\n"); fflush(stderr); } va_end(args); } Void ns_main_earlyfatal(const char *format, ...) { va_list args; va_start(args, format); if (ns_g_lctx != NULL) {

python语言经典入门级案例(含源代码)

python经典入门级案例(含源代码) 案例一: 题目:有四个数字:1、2、3、4,能组成多少个互不相同且无重复数字的三位数?各是多少? 程序分析:可填在百位、十位、个位的数字都是1、2、3、4。组成所有的排列后再去掉不满足条件的排列。 程序源代码: #!/usr/bin/python # -*- coding: UTF-8 -*- for i in range(1,5): for j in range(1,5): for k in range(1,5): if( i != k ) and (i != j) and (j != k): print i,j,k 以上实例输出结果为: 123 124 132 134 142 143 213 214 231 234 241 243

案例二: 题目:企业发放的奖金根据利润提成。利润(I)低于或等于10万元时,奖金可提10%;利润高于10万元,低于20万元时,低于10万元的部分按10%提成,高于10万元的部分,可提成7.5%;20万到40万之间时,高于20万元的部分,可提成5%;40万到60万之间时高于40万元的部分,可提成3%;60万到100万之间时,高于60万元的部分,可提成1.5%,高于100万元时,超过100万元的部分按1%提成,从键盘输入当月利润I,求应发放奖金总数? 程序分析:请利用数轴来分界,定位。注意定义时需把奖金定义成长整型。 程序源代码: #!/usr/bin/python # -*- coding: UTF-8 -*-

i = int(raw_input('净利润:')) arr = [1000000,600000,400000,200000,100000,0] rat = [0.01,0.015,0.03,0.05,0.075,0.1] r = 0 for idx in range(0,6): if i>arr[idx]: r+=(i-arr[idx])*rat[idx] print (i-arr[idx])*rat[idx] i=arr[idx] print r 以上实例输出结果为: 案例三: 题目:一个整数,它加上100后是一个完全平方数,再加上168又是一个完全平方数,请问该数是多少? 程序分析: 假设该数为x。 1、则:x + 100 = n2, x + 100 + 168 = m2 2、计算等式:m2 - n2 = (m + n)(m - n) = 168

软件著作权源程序代码