Learning Notes of mooc, Peking University, Foundation of Programming and Algorithms

1:   Idea analysis:       My realization is as follows: #include <iostream> using namespace std; double exp_value(); double elem_value(); double yz_value(); int main() { printf("%0.2f\n",exp_value()); return 0; } double exp_value() { double result=elem_value(); while(true) { ...

Posted on Sun, 13 Oct 2019 12:17:58 -0700 by knight

Will illegal address access in kernel state panic

https://mp.weixin.qq.com/s?__biz=MzAwMDUwNDgxOA==&mid=2652663676&idx=1&sn=b18ab57322594ebb8e7072e635e8bd1c&chksm=810f29e1b678a0f7238e8a71fd88f14c3c71e65556d149bbe851f08f775300bc7bb6ddbb503a&mpshare=1&scene=1&srcid=07302BR8M8OSgsym8wtFHNaB&sharer_sharetime=1564482704949&sharer_shareid=6a5d5f4082de4dfaafd2e3b24 ...

Posted on Sun, 13 Oct 2019 11:46:16 -0700 by acheoacheo

Greedy Interval Problems

Interval Covering Problem There are N closed intervals [Ai, Bi] on the axis of the number. Choose as few intervals as possible to cover a specified line segment [S, T]. Read-in preprocessing, directly ignore the outside of the interval, according to the left endpoint from small to large sorting, start to find the right endpoint that satisfies ...

Posted on Sun, 13 Oct 2019 10:54:40 -0700 by azeem123456

Understand thoroughly why arrays (strings) allocated on the stack cannot be used as return values

background Recent preparations From C Language Zero Foundation to PHP Extended Development Practice In the course of the case, the following code fragments are prepared to demonstrate the parsing of http scheme #include <stdio.h> #include <stdlib.h> #include <string.h> char *parse_scheme(const char *url) { char *p = strst ...

Posted on Sun, 13 Oct 2019 02:08:39 -0700 by BMurtagh

Wechat Domain Name Interception Detection API Interface

What is Wechat Domain Name Interception Detection?Because Wechat is strict with the content specification of external links, it may be judged as violating the content specification or being maliciously reported and complained by peers. As a result, the situation of "stop visiting this web page" occurs, which leads to the loss of a la ...

Posted on Sat, 12 Oct 2019 09:27:59 -0700 by shadow1200

Apache-Shiro Custom Realm Reality

Introduction to custom Realm In general, custom Realm inherits AuthorizingRealm. Inheritance of Realm: Authorizing Realm - > Authenticating Realm - > Caching Realm - > Realm. step Create a class that inherits AuthorizingRealm. Rewrite the authorization method doGetAuthorization Info. Rewrite the authentication method doGetAuthen ...

Posted on Sat, 12 Oct 2019 08:27:42 -0700 by mysqlnewjack

How to Restore the Misdeleted tree Command

Examine the usage of RPM and yum 1. Delete the tree command, the tree command is not available [root@centos7 ~]# which tree /usr/bin/tree [root@centos7 ~]# rm -f /usr/bin/tree [root@centos7 ~]# tree . bash: tree: command not found... 2. Direct yum or rpm installation will prompt tree to be installed [root@centos7 ~]# yum install tree Loaded ...

Posted on Fri, 11 Oct 2019 13:55:15 -0700 by Double_M

Weekly algorithmic problem 006: Lottery combination

Question: There are three teams, each with two players.team1:A,B;team2:C,D;team3:E,F; Now there is one person in each team to form a team to explore. Please list all the ways to form a team. Train of thought: This is a combination problem. If you choose one person in each team, there should be 222 = 8 combinations.If the solution is violent, i ...

Posted on Fri, 11 Oct 2019 12:53:52 -0700 by jsims

Question C: [Example 3] The sum of the first n terms of Fibonacci

Question C: [Example 3] The sum of the first n terms of Fibonacci Time limit: 1 Sec Memory limit: 128 MBSubmission: 12. Solution: 8 [Submission][state][Discussion Edition [proposition people: quanxing][Edit] [TestData] Topic link: http://acm.ocrosoft.com/problem.php?cid=1704&pid=2 Title Descri ...

Posted on Fri, 11 Oct 2019 12:52:15 -0700 by 156418

Chapter 3 Data Structure

String print("hello".capitalize()) # title case print("hello".count('l')) # Statistics of the number of occurrences of a character print("hello".find('l')) # When you find the first one, you go back to where you are. You won't continue looking back. print("hello".find('m')) # Return when you can't find it -1 #Return Hello 2 ...

Posted on Fri, 11 Oct 2019 10:33:46 -0700 by flash gordon