Giter VIP home page Giter VIP logo

blogs's People

Watchers

 avatar  avatar

blogs's Issues

IM工具用户体验对比

立个flag,准备研究下wechat,whatsapp,telegram,等几个主流IM工具的用户体验问题

工欲善其事,必先利其器--vscode简单使用

背景介绍

  • 微软2015.04正式发布
  • 全平台(基于electron)
  • 定位:位于编辑器和IDE之间
  • 开源,社区活跃(众多优秀的插件)
  • Typescript写就

特性

  • overview
  • 流畅,加载大文件几乎秒开
  • Js等内置语法发亮和补全,智能提示
  • 集成git,快速diff
  • 自带调试功能
  • 哪里不好用,自己写插件呐
  • 多窗口实时编辑与预览(预览md⇧⌘V )
  • 利用插件定制化,魔改界面
  • 内置支持了很多语言(开箱即用)

和其他编辑器对比

  • 对比atom,sublime,快
  • 对比sublime,开源,修复快,插件丰富,高度可配置
  • 可以将之前编辑器的使用习惯迁移
  • 对比atom,占用内存少
  • TERMINAL的集成,vim支持

界面风格设置

匹敌ide的插件

  • vscode-icon

  • Path Intellisense 路径补全

  • npm Intellisense node模块补全

  • Bracket Pair Colorizer
    让括号拥有独立的颜色,易于区分。可以配合任意主题使用。

  • filesize
    在底部状态栏显示当前文件大小,点击后还可以看到详细创建、修改时间
    image

  • Settings Sync,多设备同步vscode配置,扩展

  • Project Manager
    在多个项目之前快速切换的工具

  • GitLens
    丰富的git日志插件

  • code snippets 提升效率利器
    子曰:"学习code snippets可能只需要5分钟,但它能让你每年少敲几万个字符"

快捷键

自带

https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf

快捷键迁移插件

image

注释相关

  • TODO Highlight
    高亮代码注释里的TODO和FIXME,也可以添加自定义表达式
  • 新特性,自带支持jsdoc注释 /**+tab

代码调试

代码检测

  • prettier
    现在prettier的资料不太全,可以自行搜索
    可以设置成保存文件时自动格式化,无法格式化的会有红色波浪线,鼠标移上按提示更改即可

最新版vscode特性一览

//TODO

文档

Mac 使用笔记

效率利器:常用的快捷键

符号说明: ⌘ - command,⌃ - control,⇧ - shift,⌥ - option,⌫ - delete
常用的快捷键列举如下:

代码相关

  • ⌘ + c, v, x, z, a: 复制、粘贴、剪切、撤销、全选
  • ⌘ + ←, →: 跳转至行首部、跳转至行尾
  • ⌘ + ⌫: 删除至行首
  • ⌥ + ←, →: 左跳一个单词、右跳一个单词
  • ⌥ + ⌫: 删除一个单词

日常操作

  • ⌘ + n, t, tab: 新建窗口、新建Tab, 切换 Tab
  • ⌘ + w, h, q: 关闭窗口、隐藏程序、退出程序
  • ⌃⌘ + f: 进入全屏模式
  • ⌘ + option + esc: 强制退出程序(第一次打开webstorm会需要的)
  • ⌘ + space: 打开spotlight搜索

触摸板

默认

  • 鼠标左击: 单指单击
  • 滚动: 双指拖动
  • 切换全屏程序: 三指拖动
  • 显示Launchpad: 四指收缩
  • 显示桌面: 四指张开
  • 推送Misson Control: 三指向上
  • 放大或缩小: 两指捏合

推荐设置

  • 右键菜单: 双指单击
  • 查询与数据检测器(貌似查单词用): 三指单击

在当前文件夹打开终端

系统偏好设置->键盘->快捷键->服务->新建位于文件夹位置的终端窗口

工具

Homebrew

  • What Does Homebrew Do? Homebrew installs the stuff you need that Apple didn’t.
  • usage: brew install wget
  • 实际使用,mac上node的卸载并不那么容易,通过brew安装的node的卸载只要通过brew卸载即可,并且可以安装不同版本node,相互切换

终端设置(iTerm2 + oh-my-zsh)

Mac下如何安装iTerm2并使用zsh iTerm2

Sourcetree

Postman

免费而强大的HTTP调试工具

参考资料

python使用jieba进行中文分词wordcloud制作词云

准备工作

抓取数据存到txt文档中,了解jieba

问题

  • jieba分词分的不太准确,比如机器学习会被切成机器和学习两个词,使用自定义词典,原本的想法是只切出自定义词典里的词,但实际上不行,所以首先根据jieba分词结果提取出高频词并自行添加部分词作为词典,切词完毕只统计自定义词典里出现过的词
  • wordcloud自身不支持中文词云,需要指定中文字体,并且现在大部分的博客提供的generate_from_frequencies方法的参数与现在的wordcloud的参数不同,现在这个方法接收的是dict类型

代码

# -*- coding: utf-8 -*-
import jieba
import os
import codecs
from scipy.misc import imread
import matplotlib as mpl 
import matplotlib.pyplot as plt 
from wordcloud import WordCloud, STOPWORDS, ImageColorGenerator

class GetWords(object):
    def __init__(self, dict_name, file_list , dic_list):
        self.dict_name = dict_name
        self.file_list = file_list
        self.dic_list = dic_list
    #获取自定义词典
    def get_dic(self):  
        dic = open(self.dict_name, 'r')
        while 1:
            line = dic.readline().decode('utf-8').strip()
            self.dic_list.append(line)
            if not line:
                break
            pass
            
    def get_word_to_cloud(self):
        for file in self.file_list:
            with codecs.open('../spider/' + file, "r",encoding='utf-8', errors='ignore') as string:
                string = string.read().upper()
                res = jieba.cut(string, HMM=False)
                reslist = list(res)
                wordDict = {}
                for i in reslist:
                    if i not in self.dic_list:
                        continue
                    if i in wordDict:
                        wordDict[i]=wordDict[i]+1
                    else:
                        wordDict[i] = 1

            coloring = imread('test.jpeg')

            wc = WordCloud(font_path='msyh.ttf',mask=coloring,
                    background_color="white", max_words=50,
                    max_font_size=40, random_state=42)

            wc.generate_from_frequencies(wordDict)

            wc.to_file("%s.png"%(file))

def set_dic():
    _curpath=os.path.normpath( os.path.join( os.getcwd(), os.path.dirname(__file__) ))
    settings_path = os.environ.get('dict.txt')
    if settings_path and os.path.exists(settings_path):
        jieba.set_dictionary(settings_path)
    elif os.path.exists(os.path.join(_curpath, 'data/dict.txt.big')):
        jieba.set_dictionary('data/dict.txt.big')
    else:
        print "Using traditional dictionary!"
 
if __name__ == '__main__':
    set_dic()
    file_list = ['data_visualize.txt', 'data_dev.txt', 'data_mining.txt', 'data_arc.txt', 'data_analysis.txt']
    dic_name = 'dict.txt'
    dic_list = []
    getwords = GetWords(dic_name, file_list, dic_list)
    getwords.get_dic()
    getwords.get_word_to_cloud()

词云示例

此图为爬取拉勾网数据挖掘工程师岗位需要制作的词云

image

源码

github

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.