This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import collections | |
import re | |
text = "I have a pen. I have a apple. oh!! Apple pen! I have a pen. I have a pineapple. oh!! Pineapple pen! Apple pen. Pineapplepen. Pen pineapple apple pen." | |
collections.Counter(s.lower() for s in re.split(r'[^\w]+',text)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
import requests | |
import time | |
url = 'http://b.hatena.ne.jp/search/text?safe=on&q=Python&users=50' | |
for n in range(3): # 3ページで中断 | |
res = requests.get(url) | |
soup = BeautifulSoup(res.content, features='lxml') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example; | |
import com.amazonaws.services.lambda.runtime.Context; | |
import com.amazonaws.services.lambda.runtime.RequestHandler; | |
import com.amazonaws.services.lambda.runtime.events.SQSEvent; | |
import java.util.UUID; | |
public class StudyLambda1 implements RequestHandler<SQSEvent, Void>, Resource { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example; | |
import com.amazonaws.services.lambda.runtime.Context; | |
import com.amazonaws.services.lambda.runtime.RequestHandler; | |
import com.amazonaws.services.lambda.runtime.events.SQSEvent; | |
import org.crac.Core; | |
import org.crac.Resource; | |
import java.util.UUID; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from concurrent.futures import ThreadPoolExecutor | |
import time | |
def func(): | |
n = 0 | |
while n < 300_000_000: | |
n += 1 | |
if __name__ == "__main__": | |
pool = ThreadPoolExecutor(max_workers=4) |
OlderNewer