emanual-interview
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -1,19 +0,12 @@ | ||
- type: reply | ||
- tag: 前端 node.js npm | ||
- difficulty: 1 | ||
- from: Google 2015笔试 | ||
- type: Reply | ||
- tag: Android Component | ||
- difficulty: 1 | ||
- from: Goolge Facebook | ||
-------- | ||
-------- | ||
在android中使用SQLiteOpenHelper这个辅助类时,可以生成一个数据库,并可以对数据库版本进行管理的方法可以是() | ||
android 的四大组件是_____,_____,_____和_____。 | ||
```option | ||
A、getWriteableDatabase() | ||
B、getReadableDatabase() | ||
C、getDatabase() | ||
D、getAbleDatabase() | ||
``` | ||
--------- | ||
答案:AB | ||
答案:activiey,service,broadcast和contentprovide |
@@ -1,15 +0,27 @@ | ||
- type: reply | ||
- tag: java | ||
- type: choice | ||
- tag: SQL | ||
- difficulty: 1 | ||
- from: 网络整理 | ||
- from: Apple Oracle | ||
-------- | ||
什么是值传递和引用传递? | ||
在SQL Server 2005中运行如下T-SQL语句,假定SALES表中有多行数据,执行查询之后的结果是()。 | ||
BEGIN TRANSACTION A | ||
Update SALES Set qty=30 WHERE qty<30 | ||
BEGIN TRANSACTION B | ||
Update SALES Set qty=40 WHERE qty<40 | ||
Update SALES Set qty=50 WHERE qty<50 | ||
Update SALES Set qty=60 WHERE qty<60 | ||
COMMIT TRANSACTION B | ||
COMMIT TRANSACTION A | ||
A、SALES表中qty列最小值大于等于30 | ||
B、SALES表中qty列最小值大于等于40 | ||
C、SALES表中qty列的数据全部为50 | ||
D、SALES表中qty列最小值大于等于60 | ||
--------- | ||
对象被值传递,意味着传递了对象的一个副本。因此,就算是改变了对象副本,也不会影响源对象的值。 | ||
答案:D | ||
对象被引用传递,意味着传递的并不是实际的对象,而是对象的引用。因此,外部对引用对象所做的改变会反映到所有的对象上。 | ||
- type: reply | ||
- tag: java | ||
- tag: | ||
- difficulty: 1 | ||
@@ -8,12 +8,6 @@ - from: 网络整理 | ||
什么是JSP指令(Directive)?JSP中有哪些不同类型的指令? | ||
你编写过的最酷的代码是什么?其中你最自豪的是什么? | ||
--------- | ||
Directive是当JSP页面被编译成Servlet的时候,JSP引擎要处理的指令。Directive用来设置页面级别的指令,从外部文件插入数据,指定自定 | ||
义的标签库。Directive是定义在之间的。下面列出了不同类型的Directive: | ||
* 包含指令(Include directive):用来包含文件和合并文件内容到当前的页面。 | ||
* 页面指令(Page directive):用来定义JSP页面中特定的属性,比如错误页面和缓冲区。 | ||
* Taglib指令: 用来声明页面中使用的自定义的标签库。 | ||
'use strict' | ||
/** | ||
* 解析key-value头信息 | ||
* @param {Array} lines lines of the content | ||
*/ | ||
function parser_setting (lines) { | ||
@@ -8,4 +12,3 @@ var setting = {} | ||
let tmp = lines[i].substring(lines[i].indexOf('-') + 1, lines[i].length) | ||
setting[tmp.split(':')[0].trim()] = tmp.split(':')[1].trim() | ||
setting[tmp.split(':')[0].trim().toLowerCase()] = tmp.split(':')[1].trim().toLowerCase() | ||
} | ||
@@ -15,11 +18,55 @@ } | ||
} | ||
/** | ||
* 解析description部分 | ||
* @param {Array} lines lines of the content | ||
*/ | ||
function parser_descriptionBody (lines) { | ||
for (let index = 0;index < lines.length;index++) { | ||
if (lines[index].startsWith('A、')) { | ||
return { | ||
description: subArray(lines, 0, index - 1).join('\n'), | ||
options: parse_option(subArray(lines, index, lines.length)) | ||
} | ||
} | ||
} | ||
return { | ||
description: lines.join('\n').trim(), | ||
options: [] | ||
} | ||
} | ||
function parser_description (lines) { | ||
return lines.join('\n').trim() | ||
function parse_option (lines) { | ||
let options = [] | ||
let tmpOptionLines = [] | ||
for (let index = 0; index < lines.length;index++) { | ||
if (/\w、/.test(lines[index])) { | ||
if ('' !== tmpOptionLines.join('\n').trim()) { | ||
options.push(tmpOptionLines.join('\n').trim()) | ||
tmpOptionLines = [] | ||
} | ||
} | ||
tmpOptionLines.push(lines[index]) | ||
} | ||
if ('' !== tmpOptionLines.join('\n').trim()) { | ||
options.push(tmpOptionLines.join('\n').trim()) | ||
tmpOptionLines = [] | ||
} | ||
// console.log('options') | ||
// console.log(options) | ||
return options | ||
} | ||
/** | ||
* 解析答案 | ||
* @param {Array} lines lines of the content | ||
*/ | ||
function parser_answer (lines) { | ||
return lines.join('\n').trim() | ||
} | ||
/** | ||
* 获取字符串的 | ||
* @param {Array} arr 数组 | ||
* @param {int} start the start index since 0 | ||
* @param {int} end the end index | ||
*/ | ||
function subArray (arr, start, end) { | ||
@@ -33,2 +80,6 @@ let res = [] | ||
/** | ||
* parser main() | ||
* @param {string} content | ||
*/ | ||
function parser (content) { | ||
@@ -62,5 +113,7 @@ let lines = content.split('\n') | ||
} | ||
question.description = parser_description(subArray(lines, start, end - 1)) | ||
let descriptionBody = parser_descriptionBody(subArray(lines, start, end - 1)) | ||
question.description = descriptionBody.description | ||
question.options = descriptionBody.options | ||
question.answer = parser_answer(subArray(lines, end + 1, lines.length)) | ||
// console.log(question) | ||
return question | ||
@@ -67,0 +120,0 @@ } |
{ | ||
"name": "emanual-interview", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "EManual integer on node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -11,2 +11,5 @@ ## emanual-interview [![v](https://img.shields.io/npm/v/emanual-interview.svg)](https://www.npmjs.com/package/emanual-interview) | ||
- 解析一份以Markdown格式的题目到指定的json格式([草案][draf-interview]) | ||
```shell | ||
@@ -19,1 +22,3 @@ $ emanual-interview jsonify --output ./dest ./fixtures/*.md | ||
Apache v2.0 © [EManual](https://github.com/EManual) | ||
[draf-interview]: http://emanual.github.io/docs/v3/interview.html |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18511
12
160
23