While Google and its products almost omnipotent, but Web Forms of powerful search engine does not properly apply to each site. If the site content is highly specialized or has a clear classification, it is necessary to use Sphinx and PHP to create an optimized local search system.
In the Internet age, people want information as fast as packaged up: quickly accessible, and is divided into small units (or byte size unit?).designer handbags In fact, in order to satisfy impatient and hungry for information of the user's needs, even the most ordinary Web sites now are required to have a quick overview of the various menu style:
· RSS is Pizza Express, will bring fresh pizza delivered on-site.
· Blog is a local Chinese restaurant for you favorite flavored dishes.
· Forum is a common occurrence (or it may be more appropriate to say that the "animal house," snatch food scene).
· The search as in the local restaurant buffet: constantly will want to eat just fill the dish, as long as your esophagus – your Chair-support.
Luckily, PHP developers can find all kinds of RSS, blog and forum software to create or improve the site. Furthermore, although Google and other search sites almost omnipotent and perform filtering traffic, but the search engine will not necessarily be a good fit for each site.
For example, if the Web site provides hundreds of new and refurbished Porsche parts, Google may parts through initiatives such as the "Carrera" generalized search to find your site, but for a more specific "used 1991 Porsche 911 Targa headlight bezel" query, it may not get accurate results.
If the site content is highly specialized or visitor expectations of search features are similar to real workflow, then the best in the Web of global search engine adds one to your site tailored to local search system (for specialized searching for more examples, see "A needle in a billion haystacks").
In this article learn how to add a PHP site in a fast and efficient, open source and free search engine. This article is not visible to Web site development. Instead, focus on the delivery of effective search results desired component: database, index, search, engine, and the PHP application programming interface (API).Computer technology
Access great sphinx
To provide a custom site search function, you must have a data source and search for the data source. For Web applications, the data source is usually a relational database, which has some of the search capabilities built in (Equality is a simple search operators, LIKE SQL operator). However, some searches may be smaller than the database can perform a more specific search, or search may be too complex, and inherent SQL JOIN unresponsive.
Programming
Wednesday, November 10, 2010
Sunday, November 7, 2010
What note of begin learning to Java
This article come from Designer handbags.
Java has its Chin like benefits made you choose it, but feel free to look through a book or online shopping around to find the answer. In this article, the author himself to learn first-hand experience of some Java and process, be a reference for beginners.
I am in the process of learning Java is mainly organized around the following areas to learn:
1. constantly remind yourself Java is an OOP language tools, rather than just coding, the only way to grasp and use Java in General.
2. in the learning process, it is best to understand the underlying mechanisms of Java, not just stay on the surface, is not a copy of the book examples can run out of the results. Note that even on a simple example is to have the patience to go over, debugging and change.
3. in the course of learning must be doing, write code, instead of holding a book and see. A lot of things and experiences you must yourself truly belong, it's best to be able to participate in some practical projects.
4. learning to a certain stage, you want to learn something. At this point you should start learning some more knowledge, more complex, such as J2EE platform, EJB development. For this part, I'd find a thinner book first understand a probably felt there was a general understanding that more technical term for a grasp. I think the stage to see the J2EE technology practice is very good, it can let you know about J2EE contain various technologies and frameworks,(lanvin handbags) as well as many practical examples to deepen their understanding of the overall understanding of J2EE.
Learning Java interest and determination to play a key role. On the above basis, I immediately began to gradually learn Java.
Building Java environment:
1. for the Windows platform to make the following settings:
set PATH = YOUR_INSTALL_ DIR\bin; C:\Windows;C:\Windows\Command
set classpath=.
2. for YOUR_INSTALL_DIR\lib\tools.jar; Linux platform to edit/etc/profile file: JAVA_HOME = your_install_dir/JDK/j2sdk
CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/td.jar:$JAVA_HOME/jr
-e/lib/rt.jar:.
PATH=$PATH:$JAVA_HOME/bin
export PATH PS1 USER LOGNAME MAIL HOSTNAME HISTSIZE HISTFILESIZE
INPUTRC JAVA_HOME CLASSPATH RESIN_HOME
Java has its Chin like benefits made you choose it, but feel free to look through a book or online shopping around to find the answer. In this article, the author himself to learn first-hand experience of some Java and process, be a reference for beginners.
I am in the process of learning Java is mainly organized around the following areas to learn:
1. constantly remind yourself Java is an OOP language tools, rather than just coding, the only way to grasp and use Java in General.
2. in the learning process, it is best to understand the underlying mechanisms of Java, not just stay on the surface, is not a copy of the book examples can run out of the results. Note that even on a simple example is to have the patience to go over, debugging and change.
3. in the course of learning must be doing, write code, instead of holding a book and see. A lot of things and experiences you must yourself truly belong, it's best to be able to participate in some practical projects.
4. learning to a certain stage, you want to learn something. At this point you should start learning some more knowledge, more complex, such as J2EE platform, EJB development. For this part, I'd find a thinner book first understand a probably felt there was a general understanding that more technical term for a grasp. I think the stage to see the J2EE technology practice is very good, it can let you know about J2EE contain various technologies and frameworks,(lanvin handbags) as well as many practical examples to deepen their understanding of the overall understanding of J2EE.
Learning Java interest and determination to play a key role. On the above basis, I immediately began to gradually learn Java.
Building Java environment:
1. for the Windows platform to make the following settings:
set PATH = YOUR_INSTALL_ DIR\bin; C:\Windows;C:\Windows\Command
set classpath=.
2. for YOUR_INSTALL_DIR\lib\tools.jar; Linux platform to edit/etc/profile file: JAVA_HOME = your_install_dir/JDK/j2sdk
CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/td.jar:$JAVA_HOME/jr
-e/lib/rt.jar:.
PATH=$PATH:$JAVA_HOME/bin
export PATH PS1 USER LOGNAME MAIL HOSTNAME HISTSIZE HISTFILESIZE
INPUTRC JAVA_HOME CLASSPATH RESIN_HOME
Friday, November 5, 2010
C language to a student enrollment system
This article comes from Designer handbags.Computer technology .
#include<stdio.h>
#include<stdlib.h>
int N1,N2,kk1,kk2,kk3;
struct couse * head1;
struct student * head2;
Struct couse//course information structure
{
int num1;
char name1[20];
int score;
Int nelepeo;//course number has been selected
Int Melepeo;//maximum number of courses
struct couse * next;
};
Struct student//student information structure
{
int num2;
char name2[20];
Int nelenum [50];//the selected course number
Int nelen;//number of the selected courses
struct student * next;
};
void Ms()
{
for(kk1=0;kk1<1100;kk1++)
for(kk2=0;kk2<1200;kk2++)
for(kk3=0;kk3<1200;kk3++);
}
Void keyboardc ()//entry course child function (from keyboard input)
{
struct couse *p1,*p2;
N1=0;
p1=p2=(struct couse*)malloc(sizeof(struct couse));
Printf ("course number \t course name \t the maximum number of course credit \t \n");
scanf("%d%s%d%d",&p1->num1,p1->name1,&p1->score,&p1->Melepeo);
p1->nelepeo=0;
head1=NULL;
while(p1->num1!=0)
{
N1=N1+1;
if(N1==1)head1=p1;
else p2->next=p1;
p2=p1;
p1=(struct couse * )malloc(sizeof(struct couse));
scanf("%d%s%d%d",&p1->num1,p1->name1,&p1->score,&p1->Melepeo);
p1->nelepeo=0;
}
p2->next=NULL;
}
Void filec ()//input keyboard sub function (from file input)
{
FILE * fp;
char filepath[20];
struct couse *p1,*p2;
N1=0;
Printf ("enter the file path you want to read:");
getchar();
gets(filepath);
if((fp=fopen(filepath,"r"))==NULL)
{
Printf ("couldn't find the file% s! \n", filepath);
exit(0);
}
p1=p2=(struct couse*)malloc(sizeof(struct couse));
fscanf(fp,"%d%s%d%d%d",&p1->num1,p1->name1,&p1->score,&p1->nelepeo,&p1->Melepeo);
head1=NULL;
while(!feof(fp))
{
N1=N1+1;
if(N1==1)head1=p1;
else p2->next=p1;
p2=p1;
p1=(struct couse * )malloc(sizeof(struct couse));
fscanf(fp,"%d%s%d%d%d",&p1->num1,p1->name1,&p1->score,&p1->nelepeo,&p1->Melepeo);
}
p2->next=NULL;
}
Void inputc ()//entry course main function
{
int i;
Printf ("\t\t\t entry course information \n");
Printf ("\n from keyboard input \n1.");
Printf ("input from file 2. \n");
Printf ("return to the main menu 3. \n");
Printf ("Please select (1 ~ 3): \n");
scanf("%d",&i);
switch(i)
{
case(1):keyboardc();break;
case(2):filec();break;
case(3):break;
}
}
Void insertc (struct couse * incouse)//course management sub function (additional courses)
{
struct couse *p0,*p1,*p2;
p1=head1;
p0=incouse;
if(head1==NULL)
{
head1=p0;
p0->next=NULL;
}
else
{
while((p0->num1 > p1->num1) && (p1->next!=NULL))
{
p2=p1;
p1=p1->next;
}
if(p0->num1 <= p1->num1)
{
if(head1==p1) head1=p0;
else p2->next=p0;
p0->next=p1;
}
else
{
p1->next=p0;
p0->next=NULL;
}
}
N1=N1+1;
}
Void delc (int num1)//course management sub function (remove courses)
{
struct couse *p1,*p2;
if(head1==NULL)
{
Printf ("\n no course, could not be deleted! \n");
goto end;
}
p1=head1;
while(num1!=p1->num1 && p1->next!=NULL)
{
p2=p1;
p1=p1->next;
}
if(num1==p1->num1)
{
if(p1==head1) head1=p1->next;
else p2->next=p1->next;
Printf ("the number of courses has been deleted! \n");
N1=N1-1;
}
Else printf ("not the number of courses! \n");
end:;
}
Void managementc ()//course management main function
{
struct couse * incouse;
int i,num1;
Printf ("\t\t\t course management \n");
Printf ("\n 1. Add new courses");
Printf ("\n delete course 2.");
Printf ("return to the main menu 3. \n");
Printf ("Please select (1 ~ 3): \n");
scanf("%d",&i);
switch(i)
{
case(1):
{
incouse=(struct couse *)malloc(sizeof(struct couse));
Printf ("course number \t course name \t the maximum number of course credit \t \n");
scanf("%d%s%d%d",&incouse->num1,incouse->name1,&incouse->score,&incouse->Melepeo);
incouse->nelepeo=0;
insertc(incouse);
break;
}
case(2):
{
Printf ("enter the number you want to delete courses: \n");
scanf("%d",&num1);
delc(num1);
break;
}
case(3):break;
}
}
Void keyboards ()//entry student information the child function (from keyboard input)
{
int i;
struct student *p1,*p2;
N2=0;
p1=p2=(struct student *)malloc(sizeof(struct student));
Printf ("student learning, student name \t \n");
scanf("%d%s",&p1->num2,p1->name2);
p1->nelen=0;
for(i=0;i<20;i++) p1->nelenum[i]=0;
head2=NULL;
while(p1->num2!=0)
{
N2=N2+1;
if(N2==1)head2=p1;
else p2->next=p1;
p2=p1;
p1=(struct student * )malloc(sizeof(struct student));
scanf("%d%s",&p1->num2,p1->name2);
p1->nelen=0;
for(i=0;i<20;i++) p1->nelenum[i]=0;
}
p2->next=NULL;
}
Void files ()//entry student information the child function (from file input)
{
int i=0;
FILE * fp;
char filepath[20];
struct student *p1,*p2;
N2=0;
Printf ("enter the file path you want to read:");
getchar();
gets(filepath);
if((fp=fopen(filepath,"r"))==NULL)
{
Printf ("couldn't find the file% s! \n", filepath);
exit(0);
}
p1=p2=(struct student*)malloc(sizeof(struct student));
fread(p1,sizeof(struct student),1,fp);
head2=NULL;
while(!feof(fp))
{
i=0;
N2=N2+1;
if(N2==1)head2=p1;
else p2->next=p1;
p2=p1;
p1=(struct student * )malloc(sizeof(struct student));
fread(p1,sizeof(struct student),1,fp);
}
p2->next=NULL;
}
Void inputs ()//entry student information main function
{
int i;
Printf ("\t\t\t entry student information \n");
Printf ("\n from keyboard input \n1.");
Printf ("input from file 2. \n");
Printf ("return to the main menu 3. \n");
Printf ("Please select (1 ~ 3): \n");
scanf("%d",&i);
switch(i)
{
case(1):keyboards();break;
case(2):files();break;
case(3):break;
}
}
Void inserts (struct student * incouse)//student information management sub function (additional information)
{
struct student *p0,*p1,*p2;
p1=head2;
p0=incouse;
if(head2==NULL)
{
head2=p0;
p0->next=NULL;
}
else
{
while((p0->num2 > p1->num2) && (p1->next!=NULL))
{
p2=p1;
p1=p1->next;
}
if(p0->num2 <= p1->num2)
{
if(head2==p1) head2=p0;
else p2->next=p0;
p0->next=p1;
}
else
{
p1->next=p0;
p0->next=NULL;
}
}
N2=N2+1;
}
Void dels (int num2)//student information management sub function (delete student information)
{
struct student *p1,*p2;
if(head2==NULL)
{
Printf ("\n not the students ' information, not deleted! \n");
goto end;
}
p1=head2;
while(num2!=p1->num2 && p1->next!=NULL)
{
p2=p1;
p1=p1->next;
}
if(num2==p1->num2)
{
if(p1==head2) head2=p1->next;
else p2->next=p1->next;
Printf ("the student information has been deleted! \n");
N2=N2-1;
}
Else printf ("the numbers of students! \n");
end:;
}
Void managements ()//student information management main function
{
struct student * incouse;
int i,num2;
Printf ("\t\t\t student information management \n");
Printf ("1. the new student information \n");
Printf ("2. delete student information \n");
Printf ("return to the main menu 3. \n");
Printf ("Please select (1 ~ 3): \n");
scanf("%d",&i);
switch(i)
{
case(1):
{
incouse=(struct student *)malloc(sizeof(struct student));
incouse->nelen=0;
incouse->nelenum[0]=0;
Printf ("student learning, student name \t \n");
scanf("%d%s",&incouse->num2,incouse->name2);
inserts(incouse);
break;
}
case(2):
{
Printf ("enter to delete a student's school number: \n");
scanf("%d",&num2);
dels(num2);
break;
}
case(3):break;
}
}
Void elect (struct student * s)//courses
{
struct couse * p;
int num1,i;
Printf ("enter a number to the course: \n");
scanf("%d",&num1);
for(i=0;s->nelenum[i]!=0;i++);
s->nelenum[i]=num1;
(s->nelen)++;
p=head1;
while(p->num1!=num1) p=p->next;
(p->nelepeo)++;
}
Void cheak ()//Student elective sub function (query optional course)
{
char e;
struct couse * c;
struct student * s;
int num2,i,j=0,t=0;
Printf ("Please enter your school number:");
scanf("%d",&num2);
s=head2;
while(s->num2!=num2 && s->next!=NULL) s=s->next;
if(s->n
#include<stdio.h>
#include<stdlib.h>
int N1,N2,kk1,kk2,kk3;
struct couse * head1;
struct student * head2;
Struct couse//course information structure
{
int num1;
char name1[20];
int score;
Int nelepeo;//course number has been selected
Int Melepeo;//maximum number of courses
struct couse * next;
};
Struct student//student information structure
{
int num2;
char name2[20];
Int nelenum [50];//the selected course number
Int nelen;//number of the selected courses
struct student * next;
};
void Ms()
{
for(kk1=0;kk1<1100;kk1++)
for(kk2=0;kk2<1200;kk2++)
for(kk3=0;kk3<1200;kk3++);
}
Void keyboardc ()//entry course child function (from keyboard input)
{
struct couse *p1,*p2;
N1=0;
p1=p2=(struct couse*)malloc(sizeof(struct couse));
Printf ("course number \t course name \t the maximum number of course credit \t \n");
scanf("%d%s%d%d",&p1->num1,p1->name1,&p1->score,&p1->Melepeo);
p1->nelepeo=0;
head1=NULL;
while(p1->num1!=0)
{
N1=N1+1;
if(N1==1)head1=p1;
else p2->next=p1;
p2=p1;
p1=(struct couse * )malloc(sizeof(struct couse));
scanf("%d%s%d%d",&p1->num1,p1->name1,&p1->score,&p1->Melepeo);
p1->nelepeo=0;
}
p2->next=NULL;
}
Void filec ()//input keyboard sub function (from file input)
{
FILE * fp;
char filepath[20];
struct couse *p1,*p2;
N1=0;
Printf ("enter the file path you want to read:");
getchar();
gets(filepath);
if((fp=fopen(filepath,"r"))==NULL)
{
Printf ("couldn't find the file% s! \n", filepath);
exit(0);
}
p1=p2=(struct couse*)malloc(sizeof(struct couse));
fscanf(fp,"%d%s%d%d%d",&p1->num1,p1->name1,&p1->score,&p1->nelepeo,&p1->Melepeo);
head1=NULL;
while(!feof(fp))
{
N1=N1+1;
if(N1==1)head1=p1;
else p2->next=p1;
p2=p1;
p1=(struct couse * )malloc(sizeof(struct couse));
fscanf(fp,"%d%s%d%d%d",&p1->num1,p1->name1,&p1->score,&p1->nelepeo,&p1->Melepeo);
}
p2->next=NULL;
}
Void inputc ()//entry course main function
{
int i;
Printf ("\t\t\t entry course information \n");
Printf ("\n from keyboard input \n1.");
Printf ("input from file 2. \n");
Printf ("return to the main menu 3. \n");
Printf ("Please select (1 ~ 3): \n");
scanf("%d",&i);
switch(i)
{
case(1):keyboardc();break;
case(2):filec();break;
case(3):break;
}
}
Void insertc (struct couse * incouse)//course management sub function (additional courses)
{
struct couse *p0,*p1,*p2;
p1=head1;
p0=incouse;
if(head1==NULL)
{
head1=p0;
p0->next=NULL;
}
else
{
while((p0->num1 > p1->num1) && (p1->next!=NULL))
{
p2=p1;
p1=p1->next;
}
if(p0->num1 <= p1->num1)
{
if(head1==p1) head1=p0;
else p2->next=p0;
p0->next=p1;
}
else
{
p1->next=p0;
p0->next=NULL;
}
}
N1=N1+1;
}
Void delc (int num1)//course management sub function (remove courses)
{
struct couse *p1,*p2;
if(head1==NULL)
{
Printf ("\n no course, could not be deleted! \n");
goto end;
}
p1=head1;
while(num1!=p1->num1 && p1->next!=NULL)
{
p2=p1;
p1=p1->next;
}
if(num1==p1->num1)
{
if(p1==head1) head1=p1->next;
else p2->next=p1->next;
Printf ("the number of courses has been deleted! \n");
N1=N1-1;
}
Else printf ("not the number of courses! \n");
end:;
}
Void managementc ()//course management main function
{
struct couse * incouse;
int i,num1;
Printf ("\t\t\t course management \n");
Printf ("\n 1. Add new courses");
Printf ("\n delete course 2.");
Printf ("return to the main menu 3. \n");
Printf ("Please select (1 ~ 3): \n");
scanf("%d",&i);
switch(i)
{
case(1):
{
incouse=(struct couse *)malloc(sizeof(struct couse));
Printf ("course number \t course name \t the maximum number of course credit \t \n");
scanf("%d%s%d%d",&incouse->num1,incouse->name1,&incouse->score,&incouse->Melepeo);
incouse->nelepeo=0;
insertc(incouse);
break;
}
case(2):
{
Printf ("enter the number you want to delete courses: \n");
scanf("%d",&num1);
delc(num1);
break;
}
case(3):break;
}
}
Void keyboards ()//entry student information the child function (from keyboard input)
{
int i;
struct student *p1,*p2;
N2=0;
p1=p2=(struct student *)malloc(sizeof(struct student));
Printf ("student learning, student name \t \n");
scanf("%d%s",&p1->num2,p1->name2);
p1->nelen=0;
for(i=0;i<20;i++) p1->nelenum[i]=0;
head2=NULL;
while(p1->num2!=0)
{
N2=N2+1;
if(N2==1)head2=p1;
else p2->next=p1;
p2=p1;
p1=(struct student * )malloc(sizeof(struct student));
scanf("%d%s",&p1->num2,p1->name2);
p1->nelen=0;
for(i=0;i<20;i++) p1->nelenum[i]=0;
}
p2->next=NULL;
}
Void files ()//entry student information the child function (from file input)
{
int i=0;
FILE * fp;
char filepath[20];
struct student *p1,*p2;
N2=0;
Printf ("enter the file path you want to read:");
getchar();
gets(filepath);
if((fp=fopen(filepath,"r"))==NULL)
{
Printf ("couldn't find the file% s! \n", filepath);
exit(0);
}
p1=p2=(struct student*)malloc(sizeof(struct student));
fread(p1,sizeof(struct student),1,fp);
head2=NULL;
while(!feof(fp))
{
i=0;
N2=N2+1;
if(N2==1)head2=p1;
else p2->next=p1;
p2=p1;
p1=(struct student * )malloc(sizeof(struct student));
fread(p1,sizeof(struct student),1,fp);
}
p2->next=NULL;
}
Void inputs ()//entry student information main function
{
int i;
Printf ("\t\t\t entry student information \n");
Printf ("\n from keyboard input \n1.");
Printf ("input from file 2. \n");
Printf ("return to the main menu 3. \n");
Printf ("Please select (1 ~ 3): \n");
scanf("%d",&i);
switch(i)
{
case(1):keyboards();break;
case(2):files();break;
case(3):break;
}
}
Void inserts (struct student * incouse)//student information management sub function (additional information)
{
struct student *p0,*p1,*p2;
p1=head2;
p0=incouse;
if(head2==NULL)
{
head2=p0;
p0->next=NULL;
}
else
{
while((p0->num2 > p1->num2) && (p1->next!=NULL))
{
p2=p1;
p1=p1->next;
}
if(p0->num2 <= p1->num2)
{
if(head2==p1) head2=p0;
else p2->next=p0;
p0->next=p1;
}
else
{
p1->next=p0;
p0->next=NULL;
}
}
N2=N2+1;
}
Void dels (int num2)//student information management sub function (delete student information)
{
struct student *p1,*p2;
if(head2==NULL)
{
Printf ("\n not the students ' information, not deleted! \n");
goto end;
}
p1=head2;
while(num2!=p1->num2 && p1->next!=NULL)
{
p2=p1;
p1=p1->next;
}
if(num2==p1->num2)
{
if(p1==head2) head2=p1->next;
else p2->next=p1->next;
Printf ("the student information has been deleted! \n");
N2=N2-1;
}
Else printf ("the numbers of students! \n");
end:;
}
Void managements ()//student information management main function
{
struct student * incouse;
int i,num2;
Printf ("\t\t\t student information management \n");
Printf ("1. the new student information \n");
Printf ("2. delete student information \n");
Printf ("return to the main menu 3. \n");
Printf ("Please select (1 ~ 3): \n");
scanf("%d",&i);
switch(i)
{
case(1):
{
incouse=(struct student *)malloc(sizeof(struct student));
incouse->nelen=0;
incouse->nelenum[0]=0;
Printf ("student learning, student name \t \n");
scanf("%d%s",&incouse->num2,incouse->name2);
inserts(incouse);
break;
}
case(2):
{
Printf ("enter to delete a student's school number: \n");
scanf("%d",&num2);
dels(num2);
break;
}
case(3):break;
}
}
Void elect (struct student * s)//courses
{
struct couse * p;
int num1,i;
Printf ("enter a number to the course: \n");
scanf("%d",&num1);
for(i=0;s->nelenum[i]!=0;i++);
s->nelenum[i]=num1;
(s->nelen)++;
p=head1;
while(p->num1!=num1) p=p->next;
(p->nelepeo)++;
}
Void cheak ()//Student elective sub function (query optional course)
{
char e;
struct couse * c;
struct student * s;
int num2,i,j=0,t=0;
Printf ("Please enter your school number:");
scanf("%d",&num2);
s=head2;
while(s->num2!=num2 && s->next!=NULL) s=s->next;
if(s->n
Thursday, November 4, 2010
C ++ of protected
When I was in for c++ do major development languages in the last few years, I have not used protected. From the bottom pulls out once a favorite book: the c++ language design and evolution ", the Chinese version of 235 pages this record:
“ ... Mark Linton went to my Office for a moment, a make impressive requests, requests for the third control hierarchy to support Stanford University are developing a library of Interviews with style. We speculate that create the word protected to indicate that some members of the class, ... "
“... Mark is the main designer Interviews. His persuasive argument is based on practical experience and from real code examples. ...”
“... About five years after the Mark in the Interviews was to prohibit a member of the protected data, because they have become the source of many bugs ... "
I don't like protected, but today, I occasionally use C + +, is no longer so much fussier. Anyway, it is difficult to make using C + +, stable design, like how to use how to use it. The key is not in c++ do special core stuff.
Today, when a protected, a little depressed. Think you can write about. This is a fundamental problem that looks like the old familiar. After all, many years do not touch, for c++ syntax is a bit rusty.
When I was young, I once thought that this code is not legitimate.
----------------------------------------------
“ ... Mark Linton went to my Office for a moment, a make impressive requests, requests for the third control hierarchy to support Stanford University are developing a library of Interviews with style. We speculate that create the word protected to indicate that some members of the class, ... "
“... Mark is the main designer Interviews. His persuasive argument is based on practical experience and from real code examples. ...”
“... About five years after the Mark in the Interviews was to prohibit a member of the protected data, because they have become the source of many bugs ... "
I don't like protected, but today, I occasionally use C + +, is no longer so much fussier. Anyway, it is difficult to make using C + +, stable design, like how to use how to use it. The key is not in c++ do special core stuff.
Today, when a protected, a little depressed. Think you can write about. This is a fundamental problem that looks like the old familiar. After all, many years do not touch, for c++ syntax is a bit rusty.
When I was young, I once thought that this code is not legitimate.
----------------------------------------------
class foo { int a; public: int foobar(foo * f) { return this->a + f->a; } };
----------------------------------------------class foo { protected: int a; }; class foobar : public foo { public: int bar(foo * f) { return this->a + f->a; } };
----------------------------------------------class foo { protected: int a; static int get_a(foo *self) { return self->a; } }; class foobar : public foo { public: int bar(foo * f) { return this->a + get_a(f); } };
---------------------------------------------
Wednesday, November 3, 2010
Relationship between programming and English
Computer recognition is 0 and 1, command, keywords and so on is English programming environment in efficiency has a natural advantage, at least now look. Because these, understand some English is very important. Otherwise you are writing code, those words to know you and you don't know them, then this is a very painful thing to do.
But if we can do for your English learning programming a threshold, I think some inappropriate. Programming is a technique, not necessarily more than graphic design, animation, design, and more advanced. The importance of the English to such a height that could put a lot of enthusiasm, even beginners can make some could have walked into this area of winding road.
I thought the other day in CCTV seen a period of "call a spade a spade", a participant's perspective is "let those who need to use English for people to learn English," but not to the "national learning English." Engaged in the programming of the developer and wish to learn programming friends, should also be required to use English. So, they need what level of English? I think, at least do not have to be a graduate of English or English designed six.Designer handbags. But if your English level reaches this level is a good thing, you can try to foreign technology document translated into Chinese to domestic users, you can than English people faster, more access to information and help.
As a tool for English itself also has a business English and many other branches, for learning to program with direct help should be a "computer language". In addition, to help their own is their persistence, like Forum fengqiang said: "however can not be one-sided emphasis on the importance of English, also depends on the learner's perseverance, lack of knowledge, to add anything. Don't know what a command key, the dictionary? ”
The information of Gucci handbags.
But if we can do for your English learning programming a threshold, I think some inappropriate. Programming is a technique, not necessarily more than graphic design, animation, design, and more advanced. The importance of the English to such a height that could put a lot of enthusiasm, even beginners can make some could have walked into this area of winding road.
I thought the other day in CCTV seen a period of "call a spade a spade", a participant's perspective is "let those who need to use English for people to learn English," but not to the "national learning English." Engaged in the programming of the developer and wish to learn programming friends, should also be required to use English. So, they need what level of English? I think, at least do not have to be a graduate of English or English designed six.Designer handbags. But if your English level reaches this level is a good thing, you can try to foreign technology document translated into Chinese to domestic users, you can than English people faster, more access to information and help.
As a tool for English itself also has a business English and many other branches, for learning to program with direct help should be a "computer language". In addition, to help their own is their persistence, like Forum fengqiang said: "however can not be one-sided emphasis on the importance of English, also depends on the learner's perseverance, lack of knowledge, to add anything. Don't know what a command key, the dictionary? ”
The information of Gucci handbags.
Tuesday, November 2, 2010
Struts 2 + Spring 2.0 + Hibernate 3.0 Integration notes
1. Add Spring 2.0 Libraries
Select the following four jar, and configure to/WEB-INF/lib next
Spring2.0 AOP Libraries
Spring2.0 Core Libraries
Spring2.0 Persistence Core Libraries
Spring2.0 WEb Libraries
At the same time, the applicationContext.xml configuration to WEB/INF.
2. Add Hibernate 3.0 Libraries
Select from the following 2 jar, and configure to/WEB-INF/lib next
Hibernate 3.0 Core Libraries
hibernate 3.0 Advanced Support Libraries
While Hibernate file selection into applicationContext.xml (i.e., not individually create hibernate configuration files as resource files into applicationContext.xml)
3. Add commons-pool-1.4.jar and commons-dbcp-1.2.2.jar two jar to the lib, to eliminate the applicationContext.xml is not found in the class of errors
4. Add five struts2 to lib in jar
commons-logging-1.0.4.jar
freemarker-2.3.8.jar
ognl-2.6.11.jar
xwork-2.0.5.jar
struts-core-1.3.5.jar
Note: due to the integration of Spring, you also need to add struts2-spring-plugin-2.0.11.2.jar
5. Configuration web.xml
5.1 configuration application context spring
<!--Spring application context of-->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext*.xml</param-value>
</context-param>
5.2 struts2 filter configuration
<!--Struts2 filters-->
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
5.3 listener configuration so that the spring at startup automatically loaded spring configuration
<!--Spring listener so that it automatically loads when you start spring configuration-->
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
5.4 configuration OpenSessionInViewFilter filters, processing transactions
<!--OpenSessionInViewFilter filters-->
<filter>
<filter-name>lazyLoadingFilter</filter-name>
<filter-class>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>lazyLoadingFilter</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>
6. configure struts.xml
Add a constant 6.1 will action submitted to the Spring handle
<constant name="struts.objectFactory" value="spring"></constant>
6.2 configuration action
7. will the action registered in struts.xml to applicationContext.xml in
8. the other ...
Select the following four jar, and configure to/WEB-INF/lib next
Spring2.0 AOP Libraries
Spring2.0 Core Libraries
Spring2.0 Persistence Core Libraries
Spring2.0 WEb Libraries
At the same time, the applicationContext.xml configuration to WEB/INF.
2. Add Hibernate 3.0 Libraries
Select from the following 2 jar, and configure to/WEB-INF/lib next
Hibernate 3.0 Core Libraries
hibernate 3.0 Advanced Support Libraries
While Hibernate file selection into applicationContext.xml (i.e., not individually create hibernate configuration files as resource files into applicationContext.xml)
3. Add commons-pool-1.4.jar and commons-dbcp-1.2.2.jar two jar to the lib, to eliminate the applicationContext.xml is not found in the class of errors
4. Add five struts2 to lib in jar
commons-logging-1.0.4.jar
freemarker-2.3.8.jar
ognl-2.6.11.jar
xwork-2.0.5.jar
struts-core-1.3.5.jar
Note: due to the integration of Spring, you also need to add struts2-spring-plugin-2.0.11.2.jar
5. Configuration web.xml
5.1 configuration application context spring
<!--Spring application context of-->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext*.xml</param-value>
</context-param>
5.2 struts2 filter configuration
<!--Struts2 filters-->
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
5.3 listener configuration so that the spring at startup automatically loaded spring configuration
<!--Spring listener so that it automatically loads when you start spring configuration-->
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
5.4 configuration OpenSessionInViewFilter filters, processing transactions
<!--OpenSessionInViewFilter filters-->
<filter>
<filter-name>lazyLoadingFilter</filter-name>
<filter-class>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>lazyLoadingFilter</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>
6. configure struts.xml
Add a constant 6.1 will action submitted to the Spring handle
<constant name="struts.objectFactory" value="spring"></constant>
6.2 configuration action
7. will the action registered in struts.xml to applicationContext.xml in
8. the other ...
The __P() macro
extern void _sig_ign __P ((int sig)); Understood as _sig_ign for function name, the macro definition __P ().
For example: # define __P (s) s and then compile the results of the above statement as extern void _sig_ign (int sig); this can be done by the macro control this function argument types, if: # define __P (s) (void) then this function becomes no parameters. P is the meaning of the parameter.
Extern void _sig_ign __P ((int sig)); this way is a relatively universal programming style, you can google it __P, will find many similar to that of function declarations, C library inside many functions so declared is due mainly to the ANSI C before the old compiler does not support the function prototype definition, use "__P macro" to ANSI and non-ANSI compiler provides a portable package. Its definition is usually as follows:
# if defined (__STDC__) || Defined (__GNUC__)
# define __P (x) x
# else # define __P (x) ()
# endif
This ANSIC's compiler will compile the sentence as extern void _sig_ign (int sig); non-ANSI C compiler will compile as extern void _sig_ign (); will not be an error, this makes under different compilers can use to increase the portability of the code.
For example: # define __P (s) s and then compile the results of the above statement as extern void _sig_ign (int sig); this can be done by the macro control this function argument types, if: # define __P (s) (void) then this function becomes no parameters. P is the meaning of the parameter.
Extern void _sig_ign __P ((int sig)); this way is a relatively universal programming style, you can google it __P, will find many similar to that of function declarations, C library inside many functions so declared is due mainly to the ANSI C before the old compiler does not support the function prototype definition, use "__P macro" to ANSI and non-ANSI compiler provides a portable package. Its definition is usually as follows:
# if defined (__STDC__) || Defined (__GNUC__)
# define __P (x) x
# else # define __P (x) ()
# endif
This ANSIC's compiler will compile the sentence as extern void _sig_ign (int sig); non-ANSI C compiler will compile as extern void _sig_ign (); will not be an error, this makes under different compilers can use to increase the portability of the code.
Subscribe to:
Posts (Atom)