Skip to content

Commit 3e244dc

Browse files
committed
commit 0006
1 parent ff4411c commit 3e244dc

File tree

4 files changed

+49
-0
lines changed

4 files changed

+49
-0
lines changed

darcycool/0006/diary/01.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Our goal is to generate for you a complete and modern Web app or microservice architecture, unifying:
2+
3+
A high-performance and robust Java stack on the server side with Spring Boot
4+
A sleek, modern, mobile-first front-end with Angular and Bootstrap
5+
A robust microservice architecture with JHipster Registry, Netflix OSS, ELK stack and Docker
6+
A powerful workflow to build your application with Yeoman, Webpack/Gulp and Maven/Gradle

darcycool/0006/diary/02.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
You can checkout a sample generated AngularJS 1 application here.
2+
3+
You can checkout a sample generated Angular 4 application here.
4+
5+
JHipster is Open Source, and all development is done on GitHub
6+
7+
If you want to code with us, feel free to join!
8+
If you like the project, please give us a star on GitHub

darcycool/0006/diary/03.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Install JHipster yarn global add generator-jhipster
2+
3+
Create a new directory and go into it mkdir myApp && cd myApp
4+
5+
Run JHipster and follow instructions on screen jhipster
6+
7+
Model your entities with JDL Studio and download the resulting jhipster-jdl.jh file
8+
9+
Generate your entities with jhipster import-jdl jhipster-jdl.jh

darcycool/0006/important_word.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# -*- coding: utf-8 -*-
2+
# 第 0006 题: 你有一个目录,放了你一个月的日记,都是 txt,为了避免分词的问题,假设内容都是英文,请统计出你认为每篇日记最重要的词。
3+
import operator
4+
import os
5+
import re
6+
7+
rootDir = 'diary/'
8+
9+
10+
def count_words(filename, words):
11+
wordDict = dict()
12+
for word in words:
13+
if word.lower() in wordDict:
14+
wordDict[word.lower()] += 1
15+
else:
16+
wordDict[word.lower()] = 1
17+
print('%s word:%s' % (filename, max(wordDict.items(), key=operator.itemgetter(1))[0]))
18+
19+
20+
for top, dirnames, filenames in os.walk(rootDir):
21+
for filename in filenames:
22+
file = open(rootDir + filename, 'r')
23+
str = file.read()
24+
reObj = re.compile('\b?(\w+)\b?')
25+
words = reObj.findall(str)
26+
count_words(filename, words)

0 commit comments

Comments
 (0)