C, C++, C#, python, java programming – the use of data types (2)

(四)Python 4.1 String (1)String usage var1 = 'Hello World!'var2 = “Python Runoob”print “var1[0]: “, var1[0]print “var2[1:5]: “, var2[1:5] Execution results of the above example: var1[0]: Hvar2[1:5]: ytho (2)String connection #!/usr/bin/python# -*- coding: UTF-8 -*-var1 = 'Hello World!&# 39;print “Output:- “, var1[:6] + 'Runoob!' (3) Escape characters \(at end of line) Line continuation character \\ Backslash symbol \' Single quote \” Double quotes \a Ring \b Backspace \e Escape \000 Empty \n Newline \v Vertical tab character \t Horizontal tab character \r Enter \f Page change \oyy The octal number ,y represents the characters from 0 to 7. For example, :\012 represents a newline. \xyy Hexadecimal number ,Begins with \x,The character represented by yy,For example& #xff1a;\x0a represents line break \other Other characters are output in normal format (4)String operator The value of the instance variable a in the following table is the string “Hello”,b The value of the variable is “Python “: Operator Description Instance + String concatenation >>>a + b 'HelloPython' * Repeat output string >>>a * 2 'HelloHello' [] Get the characters in the string through index >>>a[1] & #39;e' [ : ] Intercept part of the string >>>a[1:4] 'ell' in Member operator – if character Returns True if…

Apriori algorithm exampleWeka, R, Python, UsingWekainmyjavacode

Apriori algorithm exampleWeka, R, Python, UsingWekainmyjavacode

In learning data mining tools, four tools are used below to study the same data set. Data description: The following data are the elective courses of 15 students. There are 10 courses for students to choose from in the course syllabus. The specific course selection is given below, which is saved in an ARFF data file named TestStudenti. .arff. I use the Apriori algorithm to mine the association rules for students’ course selection. @relation test_studenti @attribute Arbori_binari_de_cautare {TRUE, FALSE}@attribute Arbori_optimali {TRUE, FALSE}@attribute Arbori_echilibrati_in_inaltime {TRUE, FALSE}@attribute Arbori_Splay {TRUE, FALSE}@attribute Arbori_rosu_negru {TRUE, FALSE}@attribute Arbori_2_3 {TRUE, FALSE}@attribute Arbori_B {TRUE, FALSE}@attribute Arbori_TRIE {TRUE, FALSE}@attribute Sortare_topologica {TRUE, FALSE}@attribute Algoritmul_Dijkstra {TRUE, FALSE} @dataTRUE,TRUE,TRUE,TRUE,FALSE,FALSE,TRUE,TRUE,FALSE,FALSETRUE,TRUE,TRUE,TRUE,TRUE,TRUE,FALSE,TRUE,FALSE, FALSEFALSE,TRUE,TRUE,TRUE,FALSE,FALSE,FALSE,TRUE,FALSE,TRUEFALSE,TRUE,FALSE,FALSE,TRUE,FALSE,TRUE,TRUE,FALSE,TRUETRUE, TRUE,FALSE,TRUE,TRUE,FALSE,TRUE,TRUE,FALSE,TRUETRUE,FALSE,TRUE,FALSE,FALSE,TRUE,TRUE,TRUE,FALSE,FALSEFALSE,TRUE,FALSE,TRUE, TRUE,FALSE,TRUE,TRUE,FALSE,TRUETRUE,FALSE,TRUE,TRUE,TRUE,FALSE,TRUE,TRUE,TRUE,FALSEFALSE,TRUE,TRUE,TRUE,TRUE,FALSE,FALSE, TRUE,FALSE,FALSETRUE,FALSE,TRUE,FALSE,TRUE,TRUE,FALSE,TRUE,FALSE,TRUEFALSE,FALSE,TRUE,FALSE,TRUE,FALSE,FALSE,TRUE,TRUE,TRUETRUE,FALSE,FALSE,TRUE,TRUE,TRUE,FALSE,TRUE,FALSE,TRUEFALSE,TRUE,TRUE,FALSE,TRUE,TRUE,FALSE,TRUE,FALSE,TRUETRUE,TRUE, TRUE,FALSE,FALSE,TRUE,FALSE,TRUE,FALSE,FALSETRUE,TRUE,FALSE,FALSE,TRUE,TRUE,FALSE,TRUE,FALSE,FALSE (1) Weka usage examples In the Apriori algorithm, set minSupprot=50%, and the minimum confidence is also set to 50%. The Weka configuration path isExplore-》Openfile (TestStudenti.arff)->Associate click on the configuration parameter information After the algorithm is completed, we get the following results: Best rules found: 1. Sortare_topologica=FALSE 13 ==> Arbori_TRIE=TRUE 13 lift:(1) lev:(0) [0] conv:(0) 2. Arbori_rosu_negru=TRUE 11 ==> Arbori_TRIE=TRUE 11 lift:(1) lev:(0) [0] conv:(0) 3. Arbori_optimali=TRUE 10 ==> Arbori_TRIE=TRUE 10 lift:(1) lev:(0) [0] conv:(0) 4. Arbori_optimali=TRUE 10 ==> Sortare_topologica=FALSE 10 lift:(1.15) lev:(0.09) [1] conv:(1.33) 5. Arbori_echilibrati_in_inaltime=TRUE 10 ==>…

How Java, PHP, Python, JS and other developers draw statistical charts

How Java, PHP, Python, JS and other developers draw statistical charts

Abstract: At present, many programmers basically use the back-end to generate data and pass it to the front-end, and then the front-end renders the data to the drawing library for display, so as to get the various results we finally saw. kind of graph, but sometimes we find that there is a lot of data that needs to be transferred. At this time, it is very slow to pass the data to the front end for analysis and display, so it is necessary to generate various statistical graphs on the back end, as follows Let’s talk about how various programmers make pictures? PHP programmers who have used PHP to create statistical charts should know that JqGraph is the golden partner of PHP. Using JqGraph we can complete the production of many charts, such as scatter charts, bar charts, line charts, stock charts, and pie charts. Wait, and the library currently supports PHP7, so we can use it with confidence. Currently, many programmers basically use the back-end to generate data and pass it to the front-end, and then the front-end renders the data to the drawing library for display, thereby obtaining the various pictures we finally see. But sometimes, we find…

storm installation (2) Installation of ZeroMQ, JZMQ, Python, Java environment

storm installation (2) Installation of ZeroMQ, JZMQ, Python, Java environment

2.ZeroMQ installation Copy the installation file zeromq-2.1.7.tar.gz to the home file path. Add permissions to files chmod +x /home/ zeromq-2.1.7.tar.gz unzip files tar -xzf /home/ zeromq-2.1.7.tar.gz Enter the file path to install cd /home/ zeromq-2.1.7 ./configure make sudo make install Installed ( An error uuid not found will be reported here. At this time, you need to install the util-linux-2.21.1.tar.gz file. Unzip it with the same installation steps, and then enter the decompressed folder ./configure –without-ncureses make sudo make install Then just install zeromq ) 3.JZMQ installation First enter the home path cd /home Download installation files git clone https://github.com/nathanmarz/jzmq.git Enter the jzmq file cd jzmq Install ./autogen.sh ./configure make sudo make install Installed ​ 4.Python installation Copy the file to the home folder Enter the home folder cd /home Add permissions chmod +x Python-2.7.6.tgz unzip files tar zxvf Python-2.7.6.tgz Install cd Python-2.6.6 ./configure make make install After the installation is complete, test whether the installation is successful python -V Python 2.7.6 Installed 5. I have already installed the Java environment when building Hadoop before, so I won’t go into details here.

Python, C, Java and C++ stand on top of each other, and the others have no chance of winning?

Python, C, Java and C++ stand on top of each other, and the others have no chance of winning?

Organization|SuMi Producedby|CSDN Theever-changingnatureoftechnologycanbetraced.ThelatestTIOBEOctoberprogramminglanguagelisthasbeenreleased.Comeandseewhatchangesareworthpayingattentionto! 01 Thefourmajorprogramminglanguages​​continuetoincreasetheirdominance Onceuponatime,theirontrianglecomposedofJava,C,andC++intheprogramminglanguageworldhasbeenstableforalongtime.Justayearago,PythonsurpassedtheClanguageandbroketheTIOBElistformorethan20years.Ittoppedthelistforthefirsttimeandcompletelybroketheoriginalirontrianglestructure.Sincethen,Pythonhasbeenmakingrapidprogress. Now,accordingtothelatestOctoberlist,TIOBEofficialspointedoutthatPython,C,JavaandC++havebeenontheTIOBEindexlistforalongtime.TheTop4languages​​alonearefaraheadoftherest,andthegapseemstobegrowing.Forexample,C++,whichranksfourththismonth,accountsfor9.92%,whichis5.5%higherthanC#,whichaccountsfor4.42%andranksfifth. In addition, in the last year, these four languages The cumulative market share is 40%, but this year, the overall share of the Top 4 languages ​​has exceeded 55%, which means that the competitive space of programming languages ​​has gradually begun to shrink, and has basically become a foregone conclusion. TIOBE CEO Paul Jansen commented on the development of this trend, “Java’s main competitor C# is gradually losing its market share, while Python’s competitors R and Ruby are more or less stable.However, for C and C++, there is a A small threat has emerged, and that is theprogramming language Rust.Rust once again entered the Top 20 on the list with a record-high market share of 0.70%. 》 In fact, many developers are concerned about the rapid rise of Rust. As expected. Because in recent years, Rust, which focuses on performance and type safety, has been favored by major manufacturers and mainstream open source projects. As CSDN reported not long ago, Microsoft has provided support for Rust in tools such as VS Code and Visual Studio. good support; Google also announced last year that Android supports the Rust language to develop operating systems and…

56e21d850438ced54845a8be858a99d7.png

javaresume obsolete method_2019 new learning roadmap released (including Java, H5 front-end, big data, Python)

Author:Shang Silicon Valley EducationSource :Official WeChat Account of Shang Silicon Valley EducationOriginal link: # xff09; —— –I want to learn programming by myself,but I don’t know where to start? –How to learn programming by myself? Efficient? –Am I learning what the company needs? Or is it outdated? –It’s really troublesome to find videos everywhere,Where can I download them in one place? now,Shang Silicon Valley’s new release “2019 New Java Learning Roadmap” “2019 New Front-end Learning Roadmap” “2019 New Big Data Learning Roadmap” “2019 New Python Learning Roadmap》 Answer your questions head-on! Q: I want to learn programming by myself,But Suffering from not knowing where to start? A: It includes four major technical directions: Java, HTML5 front-end, big data, and Python artificial intelligence. Progress from shallow to deep. 0Basic novices learn step by step ,It is no difficulty to advance step by step;Friends with programming basics,can check and fill in the gaps according to the road map,Perfect their own knowledge system, #xff0c;Moving towards a higher level. Q: How can self-study be more efficient? A: Learning roadmap is a good helper to improve learning efficiency. Self-taught programming: The fear is that I can’t find the right direction. I don’t know what stage…

14150514_3YBp.png

phppython performance_Java, Python, Ruby, PHP, C and other language performance comparison

Code function:loop splicing string,and replace substring Hardware environment:Intel Core2 Duo T7500@2.20Ghz CPU; 2 GB RAM; OS Debian GNU/Linux 2.6.32 i686 Code execution time Code performance comparison chart Slowest: Java gcj (native executable) Slower: Java (openJDK); Java (Sun); Lua Slightly slower: tcl; Javascript (spidermonkey) Faster: Python; Ruby; PHP; C++; Javascript V8; C; Perl5 The fastest is Perl,The slowest gcj,Can you accept it? Memory usage Memory comparison chart: Test source code: C (source); Result: C gcc (Debian 4.4.4-1) 4.4.4 #include #include #include #include int main(){ setbuf(stdout,NULL); //disable output buffering char *str&# 61;malloc(8); strcpy(str,”abcdefgh”); str=realloc(str,strlen(str)+8); strcat(str,”efghefgh”); //sprintf(str,”%s%s”,str,”efghefgh”); int imax=1024/strlen (str)*1024*4; printf(“%s”,”exec.tm.sec\tstr.length\n”); //fflush(stdout); time_t starttime=time(NULL); char *gstr=malloc(0); int i=0; char *pos; int lngth; char *pos_c=gstr; int str_len=strlen(str); while(i++ <imax+1000){ lngth=strlen(str)*i; gstr= realloc(gstr,lngth+str_len); strcat(gstr,str); //sprintf(gstr,”%s%s”,gstr,str); pos_c+=str_len; pos=gstr; while(pos=strstr(pos,”efgh”)){ memcpy(pos,”____”,4); } if(lngth % (1024*256)==0){ printf(“%dsec\t\t%dkb\n”,time(NULL)-starttime,lngth/1024); //fflush(stdout); } } //printf(“%s\n”,gstr); } C++ (source) Result: C++ g++ (Debian 4.4.3-7) 4.4.3 #include #include #include using namespace std; main () { string str &#61 ; “abcdefgh”; str += “efghefgh”; int imax = 1024 /str.length() * 1024 *4; time_t currentTime = time(NULL); cout <<"exec.tm.sec\tstr.length" <<endl; string find= “efgh”; string replace =”____”; string gstr; int i=0; int length; // int end=0; // size_t end=0; while(i+&# 43; <imax +1000){ gstr += str; gstr…

Regarding the web, which one among Java, PHP, Python, and .NET has the best future development prospects?

Reply content: If you choose Java or C# in moderation, you should never die of hunger. If you want to do something else, use python and ruby. Startups generally use them. It’s not that Java and C# are not good, or that the languages ​​are good or bad, it’s just whether they are suitable or not. There is a huge demand for Java and C# developers in China, and even if they are not writing for the web, they can write for other things. The so-called development, I think, has two points:1. The depth of language and related technologies. 2. Market share. For PHP, it lies in development efficiency. You can quickly implement a website using it, but when your website needs powerful services in the background (such as large e-commerce systems, searches, etc.), PHP cannot satisfy you. , so you see that companies that use PHP will basically recruit engineers in other languages ​​​​(such as Baidu). It is impossible to implement an entire complex system simply using PHP. For Java, although it cannot keep up with PHP in terms of web development efficiency, it has many enterprise-level frameworks and platforms. Some companies often no longer want to recruit specialized…

[Benefits] Java, python, big data, mysql, oracle study guide!  !

[Benefits] Java, python, big data, mysql, oracle study guide! !

[Benefits] Java, python, big data, mysql, oracle study guide! ! Recently, the editor has discovered that many fans will leave messages and private messages asking me if I have XX e-books. The editor is grateful and thanks the fans for their persistence, so after searching for days and nights on the Internet for famous e-books related to various languages, frameworks, middleware, and databases, I finally got 80 This+ is a Chinese high-definition e-book. Note: Chinese high-definition version (only a few big data books are in English, haha). The following is the e-book catalog: Divided into Java, Linux, Mysql, Oracle, Python, frameworks, and big data 【小bian VX:Mrsongww】 Java: The catalog contains e-books on basic, advanced, and advanced Java. You can read different stages according to your own needs. If you are a beginner and don’t know where to start, you can add the editor for a private chat and the editor will recommend it to you~~ Highly recommended: “Effective Java”, “Head First Java”, “Java 8 Practical Combat”, “Java Crazy Lecture Notes” Linux: Contains Linux basic, advanced, and advanced e-books. Suggestions: “Brother Niao’s Linux Private Cooking – Basics” -> “Linux Command Line and Shell Script Programming Encyclopedia” -> “In-depth Understanding of the…

What are the characteristics or advantages of each of the programming languages ​​PHP, Java, Python, C, and C++?

What are the characteristics or advantages of each of the programming languages ​​​​PHP, Java, Python, C, and C++? phpjavapythonCC++ phpAs we all know, PHP language is a scripting language for server-side development and is very famous in website development. Since its creation by Rasmus Lerdorf in 1995, according to a W3Techs survey, PHP has accounted for 82% of known server-side programming languages. Among them are well-known technology companies such as WordPress and Facebook. The release of PHP7 in 2015 greatly improved performance and made PHP more powerful. However, like all technologies, reviews are mixed, with some people liking it and others not. Today, Dana PHP expert (http://PHP.tedu.cn) analyzes the advantages and disadvantages of PHP language with everyone. Advantage 1: Popular and easy to use PHP is currently the most popular programming language, there is no doubt about it. It drives more than 200 million websites around the world, and more than 81.7% of the world’s public websites use PHP on the server side. Not only that, according to statistics, 78.1% of people working in PHP believe that PHP is the easiest to learn and get started. This is because PHP’s commonly used data structures are built-in, which is convenient and…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索