Git Product home page Git Product logo

node-daily-practice's People

Contributors

barretlee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

lottid wtz

node-daily-practice's Issues

待选问题列表

  1. 每次都要登录到github页面来添加 issue,希望可以在本地操作,一个命令完成本地问题同步到 issue 列表。

Day3 大数据处理

**需求:**读取 log 日志,分析 category 为自定义类型的数据,产出报表。

**场景:**log 日志的接口有两个参数,startTime 和 endTime,分别表示收集日志的起始时间和结束时间,接口每次最多吐出 1w 条数据。

**问题:**数据至少有 1 亿条,不使用数据库,拿到 category 为 A B C 的每日数量,监控每日增量,增量过大则邮件警报。

Day1 抓虫

问题:使用 NodeJS 抓取 http://www.alloyteam.com/ 页面上的文章列表,以如下格式保存到 article.md 文件中。

[文章名字1](文章链接1)
> 文章简介1
[文章名字2](文章链接2)
> 文章简介2

先只考虑首页的爬虫,后续思考:

  1. 整站页面的文章列表爬取
  2. 整站页面的具体文章内容爬取
  3. 定期爬取
  4. 制作成 .mobi 或者 .pdf 格式,方便保存到 kindle 中阅读

Day2 遍历文件

问题:遍历某个目录下所有的 json 文件,将这些文件的文件名和文件目录保存到指定的位置。

后续思考:

  1. 过滤 node_module 文件件下的 JSON 文件
  2. 使用同步方式编写异步代码
  3. 使用 Promise 编程,让程序更加易读
  4. 当文件层级达到一千层的时候如何优化代码

Day4 MySQL数据库操作

对于数据库这块,了解的实在是不怎么深入。除了基本的增删改查和一点查询技巧之外,知之甚少。相信这些也都是很多前端工程师的软肋。

Day5 父子进程的通讯和控制

定时跑一个程序,这个程序会发送很多网络请求,挂掉的可能性是很大的,如果只是在程序内做些容错控制,内存会暴涨,也不方便对错误做梳理。

现打算,使用 Master 来控制多个 Child,Child 进程挂了之后,Master 重新启动,Child 不做过多的错误处理,出了问题就重来,大的任务分解成小任务,通过 Master 来分发管理。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.