Wednesday, November 10, 2010

Ues PHP build custom search engine

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.

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

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

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.
----------------------------------------------
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.

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 ...

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.

Simple IOC container

First look at the spring, will feel good magic IOC. You do not want to set a value, use it every time you take it. It is how to implement? core is the IOC container. It is mysterious? $? is actually very simple, just read a configuration file, corresponding to the Bean, and then assign a value to the Bean on the line, the taken time to directly use the getBean method to get.
Crap, we have to write a simple IOC container, to prove that in fact it is.
First name we came exactly as it appears in the Spring, so that the test is feeling like in Spring.
Our test case is such that the two classes, User and People, and in the User name and age, People, and a reference to the User. Call the People in the User's say method print. Look at these two classes.
User class

People class

Then we write a configuration file, placed in the src directory.

Then, let's write the IOC, first declare an interface!
ApplicationContext

Followed by the implementation. ClassPathXMLApplicationContext class.
First of all be constructed method
This method is the core of the IOC, here I am using jdom to handle xml files, dom4j, does not matter.

Aspects of Java and PHP Web development

Compare PHP and JSP both Web development technologies, in the current situation is in fact more PHP and Java Web development. The following is my main aspects:

   1, the language comparison

PHP is an interpreted scripting language for the server, first of all php have simple easy characteristics. Syntax and the c language comparison like, so learn c programmers can quickly become familiar with PHP's development. And java need to learn java syntax and be familiar with some of the core class libraries, object-oriented programming methods. So rather than php to learn java.
First compiled into Java bytecode .class file, and then in the Java virtual machine interpretation. Java Web development is easiest to think of first is JSP (now to JSP2.0), the original java Web development is achieved with a servlet and servlet used to develop need programmers in Java source files in the HTML code for embedding a lot. It later appeared JSP, JSP can be easily embedded into html files, jsp files are actually executed on the server when the application server will first be converted to a servlet, then compile. Servlet and Jsp can support strong JavaBean. JavaBean is a reusable, cross-platform software components. Using javabean can facilitate the implementation of the java code and separation of html, can improve system functionality and software reusability.
Java Web development is part of Sun's J2EE which defined specifications. And include in the J2EE Java Web development in all its aspects, such as JSP, Servlet, JDBC, JNDI, JAVABEAN, EJB, etc. J2EE is particularly suitable for large-scale enterprise applications.

   2. comparison of database access

Java via JDBC to access the database through different database vendors provide a database-driven, easy access to the database. Access a comparative consolidated database interface.
PHP for different databases use different database access interface, database access code of commonality is not strong. For example: Java Web application from MySQL database to Oracle database only need minor modifications. And PHP you need to do a lot of modifications.

   3. system design schema compare

Use Java Web development technology, you need to use the object-oriented design methodology, and PHP or process-oriented development methodologies. So the early Java developers need to do a lot of system analysis and design work.

   4, cross-platform

Java and PHP has a very good cross-platform features. Almost everything you can not make any modifications to run on Linux or Windows, and so on different operating systems.

   5. development cost comparison

The most classic combinations of PHP is PHP + MySQL + Apache. Very suitable for the development of small and medium-sized Web applications exploitation of faster. And all the software is open source free, can reduce inputs.
Java Web application server with Tomcat, JBoss, etc. free of charge, if you need better commercialization services are: Web Sphere and the Web logic.

C and c++ learning journey

Always been the students asked, how to learn the C and c++ are not lost and is not arbitrary in that thought for a moment, here to give a general answer.
1, you can consider learning C.

Most of the time, we learn a language is not intended to be a language expert, but rather wants to be an expert to solve the problem. To be a useful for programmers, do a make money programmers. Our value, the value will be reflected in the customer instead of language is well written.

C++ is an object-oriented C, C ++ to C expansion of a large-scale application, complex system structure of the Organization and control methods, however, I think, C + + bones or C.

After all, solve specific problems, each function is used within the C way to write the program or process-oriented.

Therefore, want to learn good C + +, my suggestion to learn C, first learn the ability to solve problems, and discuss solutions to problems. Is to learn how to walk, then learn how to run.

2. learning C process, be sure to understand the thinking of structured programming.

Why do I have in front of the article says, the software development process, the language is a process of privatization of data, the application of large projects, stressing the high cohesion and low coupling, modular design, keep the code maximum flexibility and security.

This is a modern engineering development of core and soul.

Therefore, use C language getting started as a way of understanding the structure of thinking, it can be said is a very convenient way. Because the C function, is getting ready for reuse. At the same time, global variables and cpp internal private variable difference, its principles, these can learn a lot of structured development thinking.

3, begin to learn C ++

C ++ is not difficult, many people find it difficult to learn C + +, in fact, because it is in C, and provides many of the concepts, particularly object, it is difficult to understand.

But I after so many years, put the issue but fades out, I think the opposite process-oriented, object-oriented, simply structured programming is a specific expression, the compiler provides a means to force the programmer must follow the data for an instance of the privatization, c++, and C, the core than this.

Now we return to C and then see if we have a global variable, or write to a cpp, and in the corresponding h file does not declare that it is not only the modules you can use the? is it is a private variable to this understanding, the class can understand?

4. learning c++ in-depth skills

C++ classes, after so many years of development, it offers many in-depth concepts, looks very complicated, in fact I see is also very simple. Such as templates, my understanding is that "class", we say yes?

Since the template by understanding, STL, ATL, static template libraries, dynamic template library, is also difficult to understand? is that a lot of class class, can realize many of the classes in the application need, do not require programmers then write their own.

Ok, the STL is understood, generic development also difficult? so-called generic development, in fact, I make a template to define a set of rules, but this algorithm, I hope that this algorithm rules, to further abstract the core data types do not limited to death, I put the various data sets in, can be used, so the only algorithm this part, I do not need to be rewritten. Do you think is this truth?

Learn here, c++, and C, in fact, have almost the same. To learn a language, that is, those who criticized too.

5. learn application development

Said earlier, the purpose is not to learn a language, is to make people think you are the experts, is to write programs to make money. Therefore, linguistics, to learn application development.

What is application development, I will be a language, however, the customer does not understand that customers say it directly in Windows me write a program, what I want. Why Windows? "because I'm used to.

OK, more often than not, the application developer must respect customer habits, General, language this dongdong, or in conjunction with specific platform development, to develop meaningful applications sell. So, in General, the client is a Windows system, the server is Linux, these are industry practice, various embedded kindness, platforms, S60, Palm, WinCE, Linux, and so on. According to their target customers.

When we selected target platform, there is a problem, what language, very often, students and commercial programmer difference here, students generally didn't have selected, you will do just what it means to Enterprise programmers who are not in, to assess needs to see which language more suitable, no language to learn.

Ok, suppose we chose C and C + +, so we need to select a development platform, Windows not have said, this is the best VC, under Linux, gcc, others are similar.

If we develop VC, and using C + +, this time, you need to consider learning MFC because this is Microsoft's standard class libraries, at least under Windows platforms, it is the most authoritative, you see not, we start from learning how to walk, go to step MFC is MFC is not a learning C ++ up must learn?