Skip to content

Commit 78ac900

Browse files
yincongxianyincongxian
yincongxian
authored and
yincongxian
committed
Merge pull request #1 from Show-Me-the-Code/master
update
2 parents 3d1c0ab + 8d22b9c commit 78ac900

13 files changed

+127
-0
lines changed

agmcs/0000/0000.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from PIL import Image, ImageDraw, ImageFont
2+
text = "52"
3+
im = Image.open('1.bmp')
4+
w,h = im.size
5+
font_size = h//4
6+
7+
draw = ImageDraw.Draw(im)
8+
font = ImageFont.truetype ("Arial.ttf",font_size)
9+
10+
text_w,text_h = draw.textsize(text,font=font)
11+
draw.text((w-text_w,0), text, fill=(255,0,0), font=font)
12+
13+
14+
im.save('heihei.bmp')

agmcs/0000/1.bmp

1.02 MB
Binary file not shown.

agmcs/0001/0001.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import uuid
2+
3+
uuids = []
4+
for i in range(200):
5+
uuids.append(uuid.uuid1())
6+
print uuids

agmcs/0004/0004.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import re
2+
with open('test.txt','r')as f:
3+
data = f.read()
4+
result = re.split(r"[^a-zA-Z]",data)
5+
print len([x for x in result if x!= ''])

agmcs/0004/test.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Henry was a pen name used by an American writer of short stories. His real name was William Sydney Porter. He was born in North Carolina in 1862. As a young boy he lived an exciting life. He did not go to school for very long, but he managed to teach himself everything he needed to know. When he was about 20 years old, O. Henry went to Texas, where he tried different jobs. He first worked on a newspaper, and then had a job in a bank, when some money went missing from the bank O. Henry was believed to have stolen it. Because of that, he was sent to prison. During the three years in prison, he learned to write short stories. After he got out of prison, he went to New York and continued writing. He wrote mostly about New York and the life of the poor there. People liked his stories, because simple as the tales were, they would finish with a sudden change at the end, to the reader��s surprise.

agmcs/0005/0005.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import os
2+
from PIL import Image
3+
4+
def resize(path):
5+
im = Image.open(path)
6+
w,h = im.size
7+
if w>640:
8+
x = w/640.0
9+
w=640
10+
h = int(h//x)
11+
if h>1136:
12+
x = h/1136.0
13+
h=1136
14+
w = int(w//x)
15+
print w,h
16+
im = im.resize((w,h),Image.ANTIALIAS)
17+
im.show()
18+
im.save(path)
19+
20+
path = 'img/'
21+
dirlist = os.listdir(path)
22+
23+
for img in dirlist:
24+
abspath = os.path.join(path,img)
25+
if os.path.isfile(abspath):
26+
resize(abspath)

agmcs/0005/img/1.jpg

247 KB
Loading

agmcs/0006/0006.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import os,re
2+
path = 'test/'
3+
dirlist = os.listdir(path)
4+
5+
for x in dirlist:
6+
abspath = os.path.join(path,x)
7+
if os.path.isfile(abspath):
8+
if os.path.splitext(abspath)[1] == '.txt':
9+
with open(abspath,'r')as f:
10+
data = f.read()
11+
result = re.split(r'[^a-zA-Z]', data)
12+
words = [x for x in result if x!='']
13+
items = dict([(i,words.count(i)) for i in words])
14+
items = sorted(items.iteritems(),key =lambda d:d[1],reverse = True)
15+
print abspath,'中出现最多的是',items[0][0],'出现了',items[0][1],'次',',其次是',items[1][0],'出现了',items[1][1],'次'
16+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
BEIJING - China will ship about 1,000 tons fresh water to water-starved Maldives via plane and vessel, according to Chinese Foreign Ministry and Defence Ministry on Saturday evening.
2+
3+
About 150,000 residents are faced with water scarcity in Male, capital of Maldives, as a fire at the Maldives Water and Sewage Company damaged some of the company's equipments and forced suspension of water supply to Male on Thursday.
4+
5+
In response to Maldivian government's request, China has provided emergency aid in cash and drinking water to the country, Chinese Foreign Ministry said.
6+
7+
China has arranged delivery of bottled water in two Chinese civil aircrafts to Male. The first plane has arrived with 12 tons bottled water at 6 am Saturday morning local time, while the second one with eight tons will get there on Saturday night, Chinese foreign ministry said, adding that more water will be sent.
8+
9+
An ocean rescue vessel of the Chinese navy suspended its escort mission and headed for Male port at 9 p.m. on Friday. With 960 tons fresh water and seawater desalting facility on board, the vessel is scheduled to arrive at the destination at 3 a.m. on Monday, Chinese Defense Ministry said.
10+
11+
Aircrafts of Chinese air force have been ready for urgent rescue mission, and the Chinese side is applying for air route with relevant countries, the defense ministry added.
12+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
BEIJING - The Chinese foreign ministry was authorized to release on Sunday a position paper of the government on the matter of jurisdiction in the South China Sea arbitration initiated by the Republic of the Philippines. The following is a translated version of the full text of the position paper:
2+
3+
Position Paper of the Government of the People' s Republic of China on the Matter of Jurisdiction in the South China Sea Arbitration Initiated by the Republic of the Philippines
4+
5+
7 December 2014
6+
7+
I. Introduction
8+
9+
1. On 22 January 2013, the Department of Foreign Affairs of the Republic of the Philippines presented a note verbale to the Embassy of the People' s Republic of China in the Philippines, stating that the Philippines submitted a Notification and Statement of Claim in order to initiate compulsory arbitration proceedings under Article 287 and Annex VII of the United Nations Convention on the Law of the Sea ( "Convention" ) with respect to the dispute with China over "maritime jurisdiction" in the South China Sea. On 19 February 2013, the Chinese Government rejected and returned the Philippines' note verbale together with the attached Notification and Statement of Claim. The Chinese Government has subsequently reiterated that it will neither accept nor participate in the arbitration thus initiated by the Philippines.
10+
11+
2. This Position Paper is intended to demonstrate that the arbitral tribunal established at the request of the Philippines for the present arbitration ( "Arbitral Tribunal" ) does not have jurisdiction over this case. It does not express any position on the substantive issues related to the subject-matter of the arbitration initiated by the Philippines. No acceptance by China is signified in this Position Paper of the views or claims advanced by the Philippines, whether or not they are referred to herein. Nor shall this Position Paper be regarded as China' s acceptance of or participation in this arbitration.
12+
13+
3. This Position Paper will elaborate on the following positions:
14+
15+
The essence of the subject-matter of the arbitration is the territorial sovereignty over several maritime features in the South China Sea, which is beyond the scope of the Convention and does not concern the interpretation or application of the Convention;
16+
17+
China and the Philippines have agreed, through bilateral instruments and the Declaration on the Conduct of Parties in the South China Sea, to settle their relevant disputes through negotiations. By unilaterally initiating the present arbitration, the Philippines has breached its obligation under international law;
18+
19+
Even assuming, arguendo, that the subject-matter of the arbitration were concerned with the interpretation or application of the Convention, that subject-matter would constitute an integral part of maritime delimitation between the two countries, thus falling within the scope of the declaration filed by China in 2006 in accordance with the Convention, which excludes, inter alia, disputes concerning maritime delimitation from compulsory arbitration and other compulsory dispute settlement procedures;
20+
21+
Consequently, the Arbitral Tribunal manifestly has no jurisdiction over the present arbitration. Based on the foregoing positions and by virtue of the freedom of every State to choose the means of dispute settlement, China' s rejection of and non-participation in the present arbitration stand on solid ground in international law.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
BEIJING - President Xi Jinping on Friday called for accelerated fulfillment of the free trade area (FTA) strategy and the building of a new economic system of openness.
2+
3+
The remarks, published on Saturday, were made at a meeting of the Political Bureau of the Communist Party of China (CPC) Central Committee on Friday.
4+
5+
The FTA strategy is an important part of China's new round of opening-up, Xi said. Multilateral trade systems and regional trade arrangements have always been the driving force behind economic globalization.
6+
7+
Global trade is experiencing the largest change since the Uruguay round of trade talks in 1994, Xi said.
8+
9+
As the economy is entering its "new normal", China needs even more opening-up to address problems in economic and social development, he added.
10+
11+
China must accelerate the FTA strategy and make FTAs play a bigger role in trade and investment, he said.
12+
13+
Accelerating the FTA strategy is an important way for China to actively participate in the rule-making of international economic and trade areas, he added.
14+
15+
We can not just be spectators and followers, but should participate and lead, make China's voice heard and inject more Chinese elements into the international rules, he said.
16+
17+
In recent years, China has been pushing forward opening-up, having signed numerous free trade agreements with more than 20 countries or regions.
18+
19+
Top-level design and planning must be improved to set up a network of FTAs, "which has a foothold in neighboring regions, and radiates across the 'Belt and Road Initiatives', to face the world," the President said.
20+
21+
The number of its FTAs needs to increase, but more attention must be paid to the quality of these FTAs with more emphasis on risk and risk assessment. Market-oriented reform will create a law-based business environment, and economic restructuring should move faster, according to the President.
22+
23+
Xi highlighted the importance of equitable, open and transparent market rules and international competitiveness of the service sector.
24+
25+
The President also wants to see better mechanisms and policies governing Chinese companies overseas.
26+

0 commit comments

Comments
 (0)