- 博客(31)
- 收藏
- 关注
原创 Github + Hexo 搭建个人博客
Github + Hexo 搭建个人博客文章目录Github + Hexo 搭建个人博客一、Github 创建个人仓库二、安装Node.js三、安装 hexo四、下载配置自己喜欢的主题并适配五、推送网站参考一、Github 创建个人仓库仓库名:用户名.github.io必须是用户名!(如我的就是 PzLu.github.io)这个页面的 Page 内容需要配置(为后续做准备)。二、安装Node.js安装教程略。三、安装 hexo创建一个文件夹,可以命名为 myBlog,
2021-07-01 23:39:59 97
原创 信息检索与分析 - 课程总结
信息检索与分析 - 课程总结文章目录信息检索与分析 - 课程总结〇 课程简介一、认识文献(分类 + 著录规则)(一)【专著】(二)【专著中的析出文献】(重点)(三)【连续出版物】(四)【连续出版物中的析出文献】 (重点)〇 课程简介从这浩如烟海的信息中快速且准确地找出所需学术信息。主要介绍文献信息的基础知识;网络信息资源检索的基本原理;各种类型(学术或科技)文献信息资源的检索工具;知识产权的相关知识。一、认识文献(分类 + 著录规则)分类规则总的规则:参照 GB/T
2021-06-21 23:13:41 1303
原创 网络信息检索 - 基本模型
网络信息检索 - 基本模型文章目录网络信息检索 - 基本模型一、基本概念(一)核心问题(二)形式表示(三)共享词袋假设1、索引词2、词的权重(四)基本模型二、布尔模型三、向量空间模型(主流模型)四、概率模型参考资料一、基本概念(一)核心问题IR 的核心问题:预测哪些文档是相关的,哪些文档是不相关的。主要工作在于排序这个核心的问题,如何计算这个排序从而处理文档的相关性。主要难点:检索过程判断相关信息十分困难。用户需求十分模糊,包括了上下文,需求等信息,必须尽量简化。检索模型的主
2021-06-17 21:26:04 440
原创 【面向对象编程】Note by Liao
面向对象编程文章目录面向对象编程1 类和实例1 类和实例class Student(object): pass
2020-11-18 21:43:58 98
原创 [6 kyu] Multiplication table
[6 kyu] Multiplication table文章目录[6 kyu] Multiplication tableQuestionSample TestMy Answer (accepted)Suggested AnswerQuestionSample TestMy Answer (accepted)def multiplication_table(size): bl = list() for i in range(1, size+1): sl = lis
2020-11-01 21:32:18 270
原创 [5 kyu] Simple Pig Latin
[5 kyu] Simple Pig Latin文章目录[5 kyu] Simple Pig LatinQuestionSample TestsMy Answer(accepted)Suggested AnswerQuestionSample TestsMy Answer(accepted)def pig_it(text): new_string = "" word_tmp = list() for word in text.split(" "): if
2020-10-26 21:55:42 179
原创 [5 kyu] Where my anagrams at?
[5 kyu] Where my anagrams at?文章目录[5 kyu] Where my anagrams at?QuestionSample TestsMy AnswerSuggested AnswerQuestionSample TestsMy Answerfrom collections import defaultdictdef anagrams(word, words): ans_list = list() word_dict = defaultdict
2020-10-26 16:23:38 149
原创 [5 kyu] Valid Parentheses
[5 kyu] Valid Parentheses文章目录[5 kyu] Valid ParenthesesQuestionSample TestsMy AnswerSuggested AnswerQuestionSample TestsMy Answerdef valid_parentheses(string): tmp_stack = [] cnt = 0 for index in range(len(string)): if string[inde
2020-10-23 15:12:27 126
原创 [5 kyu] Human Readable Time
[5 kyu] Human Readable Time文章目录[5 kyu] Human Readable TimeQuestionSample TestsMy Answer (accepted)Suggested AnswerQuestionSample TestsMy Answer (accepted)def make_readable(seconds): if seconds >= 0 and seconds < 60: one_part = "00:
2020-10-22 22:22:49 126
原创 [6 kyu] Bit Counting
[6 kyu] Bit Counting文章目录[6 kyu] Bit CountingQuestionSample TestsMy Answer (accepted)Suggested AnswerQuestionSample TestsMy Answer (accepted)def count_bits(n): count = 0 str_bits = "" if n == 0: return 0 else: while n//2
2020-10-21 17:23:38 149
原创 Cross-Lingual text Classification with Minimal Resources by Transferring a Sparse Teacher
Cross-Lingual text Classification with Minimal Resources by Transferring a Sparse Teacherhttps://arxiv.org/pdf/2010.02562.pd文章目录Cross-Lingual text Classification with Minimal Resources by Transferring a Sparse TeacherCLTS 模型 (cross-lingual teacher-stud
2020-10-13 22:22:48 225
原创 [7 kyu] List Filtering
[7 kyu] List FilteringQuestionSample TestsMy Answer (accepted)def filter_list(l): return [i for i in l if isinstance(i,int)]Suggested Answerdef filter_list(l): 'return a new list with the strings filtered out' return [i for i in l if not i
2020-10-10 15:57:23 124
原创 [6 kyu] Sum two arrays
[6 kyu] Sum two arraysQuestionSample TestsMy answer (accepted)def sum_arrays(array1,array2): print(array1) print(array2) if not array1: return array2 if not array2: return array1 if not array1 and not array2:
2020-10-09 13:46:53 126
原创 [4 kyu] Matrix Determinant
[4 kyu] Matrix Determinant文章目录[4 kyu] Matrix DeterminantQuestionSample TestsMy Answer (accepted)Suggested AnswerQuestionSample TestsMy Answer (accepted)"""Matrix Determinant (n*n)Calculate the determinant with Laplace expansion method"""def get
2020-10-08 15:58:04 407
原创 [*5kyu] Calculating with Functions
[*5kyu] Calculating with Functions文章目录[*5kyu] Calculating with FunctionsQuestionSample TestsSuggested AnswerQuestionSample TestsSuggested Answerdef zero(fun=None): return 0 if not fun else fun(0)def one(fun=None): return 1 if not fun else fun(1) d
2020-10-07 15:35:32 178
原创 [5 kyu] PaginationHelper
[5 kyu] PaginationHelper文章目录[5 kyu] PaginationHelperQuestionSample TestsMy Answer (accepted)Suggested AnswerQuestionSample TestsMy Answer (accepted)# TODO: complete this classclass PaginationHelper: # The constructor takes in an array of items
2020-10-06 22:10:46 241
原创 [5 kyu] The Hashtag Generator
[5 kyu] The Hashtag Generator文章目录[5 kyu] The Hashtag GeneratorQuestionSample TestsMy Answer (accepted)Suggested AnswerQuestionSample TestsMy Answer (accepted)def generate_hashtag(s): # situation 1 if not s: return False # situati
2020-09-22 08:33:03 152
原创 [4 kyu] Strip Comments
[4 kyu] Strip Comments文章目录[4 kyu] Strip CommentsQuestionSample TestsMy Answer (accepted)Suggested AnswerQuestionSample TestsMy Answer (accepted)def solution(string,markers): string_piece = string.split("\n") return_piece = list() for uni
2020-09-21 22:24:41 167
原创 [6 kyu] Duplicate Encoder
[6 kyu] Duplicate Encoder文章目录[6 kyu] Duplicate EncoderQuestionSample TestsMy Answer (accepted)Suggested AnswerQuestionSample TestsMy Answer (accepted)def duplicate_encode(word): # unique lower c unique_char = list() for c in word.lower()
2020-09-20 09:21:08 212
原创 [6 kyu] Array.diff
[6 kyu] Array.diff文章目录[6 kyu] Array.diffQuestionSample TestsMy Answer (accepted)Suggested AnswerQuestionSample TestsMy Answer (accepted)def array_diff(a, b): for index in range(len(a)-1, -1, -1): #Reverse order, back to front if a[index]
2020-09-17 19:01:03 122
原创 [6 kyu] Split Strings
[6 kyu] Split Strings文章目录[6 kyu] Split StringsQuestionSample TestsMy Answer (accepted)Suggested AnswerQuestionSample TestsMy Answer (accepted)def solution(s): index = 0 ans_list = list() while index < len(s) - 1: ans_list.appe
2020-09-17 17:33:57 128
原创 [7 kyu] Growth of a Population
[7 kyu] Growth of a Population文章目录[7 kyu] Growth of a PopulationQuestionSample TestsMy Answer (accepted)Suggested AnswerQuestionSample TestsMy Answer (accepted)def nb_year(p0, percent, aug, p): final_people_num = 0 year = 0 real_percent
2020-09-17 16:54:50 168
原创 [6 kyu] IQ Test
[6 kyu] IQ Test文章目录[6 kyu] IQ TestQuestionSample TestsMy Answer (accepted)Suggested AnswerQuestionSample TestsMy Answer (accepted)def iq_test(numbers): type_num = list() for item in numbers.split(" "): if int(item) % 2: t
2020-09-16 21:36:58 95
原创 [6 kyu] Are they the “same“?
[6 kyu] Are they the “same”?文章目录[6 kyu] Are they the "same"?QuestionSample TestsMy Answer (weak accepted)Suggested AnswerThinkingQuestionSample TestsMy Answer (weak accepted)def comp(array1, array2): print(array1) print(array2) if
2020-09-16 21:22:31 890
原创 [7 kyu] Sum of odd numbers
[7 kyu] Sum of odd numbers文章目录[7 kyu] Sum of odd numbersQuestionSample TestsMy Answer (Accepted)Suggested AnswerQuestionSample TestsMy Answer (Accepted)def row_sum_odd_numbers(n): return n*n*nSuggested Answerdef row_sum_odd_numbers(n): #y
2020-09-16 20:21:59 237
原创 [6 kyu] Find the odd int
[6 kyu] Find the odd intQuestionSample TestsMy Answer (Accepted)from collections import defaultdictdef find_it(seq): unique = set(seq) count_dict = defaultdict(int) for item in seq: if item in unique: count_dict[item]
2020-09-16 15:42:43 128
原创 [6 kyu] Who likes it?
[6 kyu] Who likes it?QuestionSample TestsMy Answer (accepted)def likes(names): num = len(names) if num >= 4: return names[0] + ", " + names[1] + " and " + str(num-2) + " others like this" if num == 3: return names[0] +
2020-09-16 13:41:42 165
原创 [7 kyu] Two to One
[7 kyu] Two to One文章目录[7 kyu] Two to OneQuestionSample TestsMy Answer (accepted)Suggested AnswerQuestionSample TestsMy Answer (accepted)def longest(s1, s2): ss1 = list(set(s1)) ss2 = list(set(s2)) ss1.extend(ss2) return "".join(sorte
2020-09-16 09:40:25 134
原创 [6 kyu] Playing with digits
[6 kyu] Playing with digits文章目录[6 kyu] Playing with digitsQuestionSample TestsMy Answer (accepted)Suggested AnswerQuestionSample TestsMy Answer (accepted)import mathdef dig_pow(n, p): ans = 0 for item in list(str(n)): ans += math.po
2020-09-15 19:17:01 180
原创 [7 kyu] Categorize New Member
[7 kyu] Categorize New Member文章目录[7 kyu] Categorize New MemberQuestionSample TestsMy Answer (accpected)Suggested AnswerQuestionSample TestsMy Answer (accpected)def open_or_senior(data): categorize = [] for (age, handicap) in data: if
2020-09-15 18:54:35 159
原创 [6 kyu] Replace With Alphabet Position
[6 kyu] Replace With Alphabet Position文章目录[6 kyu] Replace With Alphabet PositionQuestionSample TestsMy Answer (passed)Suggested AnswerQuestionSample TestsMy Answer (passed)def alphabet_position(text): position_list = [] alphabet_set = {} st
2020-09-15 10:07:18 181
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人