使用百度深度学习模型ERNIE对输入的字符串做分类预测(基于fluid) #! /usr/bin/env python# author: qibaoyuan - qibaoyuan@xiaomi.com 2019.08.01# just demo, no guranteesimport collectionsimport timeimport paddle.fluid as fluidimport numpy as np#可以参考ernie的re...
Jenkins CI持续集成(基于Git) 1.使用Jenkins结合Gitolite(git服务)进行持续集成:1.1 下载Jenkins的war包:http://mirrors.jenkins-ci.org/war/latest/1.2安装git插件:http://updates.jenkins-ci.org/download/plugins/git/2.4.0/git.hpi,依赖也要一块下载:sim-api.hpi,gi
brew安装半路退出 rm -rf /usr/local/Cellar /usr/local/.gitsee:http://stackoverflow.com/questions/13389760/homebrew-is-halfway-installed-cant-re-install-or-uninstall-how-can-i-manuall
Latex Tools在OSX EI Captain无法编译的问题 1.异常:COULD NOT COMPILE! latextools Attempted command:latexmk2.原因:EI中对于/usr/bin的权限限制了,因此mactex在最新的版本中将texbin目录修改了,而LatexTools中的默认配置,并没有修改。3.解决:Packages Setting->LatexTools->Setting user,将osx下面改为:
创建centos7下的加密移动硬盘 创建centos7下的加密移动硬盘机器山插了一块移动硬盘,为了安全,使用了加密方法:代码如下:cryptsetup luksFormat /dev/sdbcryptsetup luksOpen /dev/sdb crypdd if=/dev/urandom of=/root/keyfile1 bs=1024 count=4chmod 0400 /root/keyfile1cryptsetup
intellij在jdk1.7和1.8的字体问题 oracle7和8在字体渲染上出现了bug,导致变细。。。至少在mac系统是这样的,anti aliasing的问题。先不管它。说一下解决方案:1.下载并安装苹果的jdk1.6,JavaForOSX2014-001.dmg2.修改intelli的启动文件:vim /Applications/IntelliJ\ IDEA\ 14.app/Contents/Info.plist将 JV
使用gitolite进行git服务管理 1.在服务器SERVER创建git用户:useradd -m git2.使用git用户登录,并安装gitolite:su - gitmkdir -p ~/bingit clone git://github.com/sitaramc/gitolitegitolite/install -ln ~/bin # please use absolute path
利用Python3对网易的某个话题进行爬取并保存图片到本地 __author__ = 'tom'import urllib.requestimport jsonimport timebaseDir = '/Users/tom/netease/{0}'request = 'http://url.163.com/{0}-10.html'count = 0for i in range(0, 2000, 10): re
Docker下玩转Storm 1.起因:构建一个storm集群,由于各种诡异的配置错误和死机无反应,直接放弃。后来看到docker,眼前一亮,搞起来。2.安装docker(参考http://docs.docker.com/installation/centos/#installing-docker-centos-6.5)centos:安装epelrpm -Uvh http://mirrors.ustc.
mac brew maven更新版本 add the following to your ~/.mavenrc:export JAVA_HOME=/Library/Java/JavaVirtualMachines/{jdk-version}/Contents/Home
mac安装zsh git clone git@github.com:robbyrussell/oh-my-zsh.gitcd ~ln -s ~/Documents/source/utils/oh-my-zsh/ .oh-my-zshcp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrcchsh -s /bin/zsh
给钓鱼邮件最致命的一击 现在的小偷、骗子太多了,被偷的东西需要解除原有的Apple ID才可以绑定新的apple id,于是各种欺骗邮件纷纷到来进行诈骗,今天告诉大家怎么讲该死的诈骗服务器搞死。 1.原理:向诈骗邮件提交各种用户名、密码、验证信息,这些信息看着像那么回事;shell信息,采用多线程,不断将垃圾信息塞到骗子的数据库中,使其应接不暇,最后绝命而死。
zsh使用小键盘 在zsh的配置文件.zshrc中添加:# Fix numeric keypad# 0 . Enterbindkey -s "^[Op" "0"bindkey -s "^[On" "."bindkey -s "^[OM" "^M"# 1 2 3bindkey -s "^[Oq" "1"bindkey -s "^[Or" "2"bindkey -s "^[Os" "3"# 4 5
Latex中插入矢量图片(带latex公式) 情景描述:在latex文件中,需要插入一张图片,图片内容包括几个圆圈、几条线和一些特殊的数学公式。方案:1.使用visio作图,然后插入数学公式。问题:导出图片的话,不是矢量,无法放大;导出pdf,进行裁剪,但是,word里的公式不是很美观,可能与latex的公式不兼容。2.使用Inkscape,制作矢量图,在图上可以输入latex格式的公式,然后使用input将文件导入。第2个方
mactex自动更新tex live utilities错误 错误描述:./runme.sh: Cannot find TeX Live root using kpsewhich --var-value=SELFAUTOPARENT.2014-12-26 02:39:16 +0000 Warning tlu_ipctask[3664] ./runme.sh: Please set your PATH as needed, otherwise it's
matlab 2014a挂掉 libmwfl 1.环境:mbp,osx10/9/42.描述文件3.reason:The crash during close window is caused on some setups sometime by some bug in Apple's CoreVideo framework. I've spent days not being able to fix it, just confir
python安装scipy sudo curl https://bootstrap.pypa.io/ez_setup.py -o - | sudo pythonsudo easy_install pipsudo pip install -U numpysudo pip install -U scipysudo pip install -U pyyaml nltk
SublimeText3与Latex结合 SublimeText3与Latex结合讲述如何在mac系统使用Latex和SublimeText3进行论文撰写软件安装安装Mactex,4G左右;安装Skim,安装以后个人偏好中,取消自动更新,选择对应的sublimeTex3;安装Package Control,按照页面 https://sublime.wbond.net/installation重启sublimeTex3Ctr
MATLAB Preparing installation files ... Installing ... Exception in thread "main" com.google.inject. 现象:MATLAB2013a在Mac Book Pro上无法安装,调用
Gitblit进行Git管理 Gitblit进行Git管理介绍使用Gitbit进行代码管理的工具下载Gitblit,当前版本为1.5.0,下载地址。使用普通的Http在下载完成时会报下载错误,有点奇怪。解决办法,使用下载工具,如迅雷、百度云离线;将下载的文件上传到服务器端,解压到opt/gitblit目录(安装服务的默认路径);由于服务是安装在远程,gitblit需要GUI配置才可以使用,因为其要生成密码和证书文件
Endnot的文献全部转换成BibTex Endnot的文献全部转换成BibTex从Endnote导出数据模板选择,Edit->Output Styles->Open Style Mamager...->选择BibTex Export.模板修改,Edit->Output Styles->Edit BibTeX Export,定位到Bibliography->Templates,右侧的模板需要修改。将ILabel删除I,只留一个
ipad通过issh访问自己的系统 ssh 登入到 iphone (可以用 putty,詳細可 google)如果還沒把密碼改掉的話 root 跟 mobile 帳號的密碼是 alpine(少部份的密碼也有可能是 dottie)1) 用 mobile 登入系統後,如果要改密碼 passwd mobile (敲入兩次密碼)2) su 到 root su - (敲入root的密碼,
贝叶斯分类在邮件分类 贝叶斯过滤算法的基本步骤 主要有以下7个步骤: 1. 收集大量的垃圾邮件垃圾邮件,英文:spam。现在还没有一个非常严格的定义。一般来说,凡是未经用户许可就强行发送到用户的邮箱中的任何电子邮件。更多>>和非垃圾邮件,建立垃圾邮件集和非垃圾邮件集。 2. 提取邮件主题和邮件体中的独立字符串,例如 ABC32,¥234等作为TOKEN串并统计提取出
mac安装gnuplot 1.下载gnuplot的源代码4.6.42.解压。切换到文件夹:export LDFLAGS=-m32export CFLAGS=-m32./configure --with-readline=builtinmakesudo make install
macos安装thrift Install BoostDownload the boost library from boost.org untar compile with./bootstrap.shsudo ./b2 threading=multi address-model=64 variant=release stage installInstall libeventDownload
C45的.data和.names文件转化成Arff数据 package cn.ac.ict.ics.utils;import lombok.Cleanup;import java.io.BufferedReader;import java.io.BufferedWriter;import java.io.FileReader;import java.io.IOException;import java.nio.charset.Chars
mysql远程 mysql> use mysql;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedmysql> SELECT User, Passwo
new io for Chinse file path @Test public void testConverter() { Path dir = Paths.get("/Users/tom/Documents/parse"); try (DirectoryStream stream = Files.newDirectoryStream(dir, "*.{json}")) { for
rabbitmq 1.download rabbit-mq server:wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.1.3/rabbitmq-server-3.1.3-1.noarch.rpm download erlang:wget https://download3.vmware.com/software/vfabric/erlan
jdk7 new api import java.nio.charset.StandardCharsets;import java.nio.file.Files;import java.nio.file.Path;import java.nio.file.Paths;import java.util.ArrayList;import java.util.List; public class WriteText
matlab basic 1.cputime returns the total CPU time (in seconds) used by your MATLAB® application from the time it was started. This number can overflow the internal representation and wrap around.
FileLock import org.junit.Ignore;import org.junit.Test;import java.io.File;import java.io.RandomAccessFile;import java.nio.channels.FileLock;public class FileLockTest { @Test public void te
macos10.8安装cplex 原理:利用matlab的mex,编译生成api interface,调用cplex完成一系列的线性规划等任务。1.matlab:版本号R2013a (8.1.0.604)64bit xcode 5 dp osx 10.8.4 cplex cplex_studio125.prev.macos.bin2.sudo vim /Applications/MATLAB_R2013a
securecrt删除license rm -rf /Users/qibaoyuan/Library/Application\ Support/VanDyke/SecureCRT/Config/SecureCRT_eval.lic
How do I change the Java Virtual Machine (JVM) that MATLAB is using? Date Last Modified: Thursday, May 3, 2012Solution ID: 1-1812JProduct: MATLABReported in Release: No ReleaseFixed in Release: R2012aPlatform: All Pla
LSI •LSIputs documents together even if they don’thave common words if–Thedocs share frequently co-occurring terms••Disadvantages:–Statisticalfoundation is missing
Solr ok status:413, message:FULL head add attribute"requestHeaderSize" before to etc/jetty.xml name="addConnector"> class="org.eclipse.jetty.server.nio.SelectChannelConnector"> name="port"> name="jetty.port" default="8080"/>
mac os 10.8.2下安装wget 1.首先安装在apple store中安装xcode2.然后下载command line tools:https://developer.apple.com/downloads/index.action?name=for%20Xcode%20-# 我下载的是:http://adcdownload.apple.com/Developer_Tools/command_line_tools_o
storm应用场景 Storm是Twitter开源的一个类似于Hadoop的实时数据处理框架(原来是由BackType开发,后BackType被Twitter收购,将Storm作为Twitter的实时数据分析)。实时数据处理的应用场景很广泛,如上篇文章介绍S4时所说的个性化搜索广告的会话特征分析。而Yahoo当初创建S4项目的直接业务需求就是为了在搜索引擎的‘cost-per-click’广告中,能根据当前情景上下文
strom grouping http://blog.sina.com.cn/s/blog_406d9bb00100ui5p.htmlstream grouping分类1. Shuffle Grouping: 随机分组, 随机派发stream里面的tuple, 保证每个bolt接收到的tuple数目相同.2. Fields Grouping:按字段分组, 比如按userid来分组, 具有
复杂网络 //http://zh.wikipedia.org/wiki/%E5%A4%8D%E6%9D%82%E7%BD%91%E7%BB%9C1.复杂网络,复杂网络是由数量巨大的节点和节点之间错综复杂的关系共同构成的网络结构。2.小世界网络:小世界网络的判定准则有两个,分别是特征路径长度短,和高集聚系数。网络的特征路径长度是指在它的图表示中,两个节点的路径长度的平均值(这里路径长度指两节点间最短路
MM1模型 //tracebakc:http://zh.wikipedia.org/wiki/M/M/11.可用M/M/1模型的例子众多,例如只有一位员工的邮局,只有一队列。客人进来,排队、接受服务、离开。如果客人进来的数目符合泊松过程,且服务时间是指数分布,则可用M/M/1模拟,并算出平均队列长度、不同等候时间的机率等。 M/M/1可一般化成为M/M/n模型,使可用时接受服务的人数为大于一。历史上
twitter storm(Stream grouping) SplitSentence对于句子里面的每个单词发射一个新的tuple, WordCount在内存里面维护一个单词->次数的mapping, WordCount每收到一个单词, 它就更新内存里面的统计状态。有好几种不同的stream grouping:最简单的grouping是shuffle grouping, 它随机发给任何一个task。上面例子里面RandomSentenc
memcached-client /** * Deletes an object from cache given cache key, a delete time, and an optional hashcode. * * The item is immediately made non retrievable. * Keep in mind {@link #add(String, Object) add}
Lucene4 TokenStream package org.apache.lucene.analysis;/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for
java字典序排序 import java.util.Comparator;import java.util.ArrayList;import java.util.Collections;public class Tester { public static void main(String[] args) { ArrayList list = new ArrayList(); list.add("东
js匹配所有符合的字符串 var str = '[09/11]FCKEditor高亮代码插件测试'; var pattern = /####(.*?)@@@/ig; while(r=pattern.exec(str)){ alert(r[1]);}
mysql add user mysql>GRANT ALL PRIVILEGES ON *.* TO admin@localhost IDENTIFIED BY 'something' WITH GRANT OPTION; mysql>GRANT ALL PRIVILEGES ON *.* TO admin@"%" IDENTIFIED BY 'something' WITH GRANT OPTION; 第一句增
LINK : fatal error LNK1104: cannot open file "nafxcwd.lib" 编译时出现此问题,说明将项目设置设为了“在静态库中使用MFC”。Microsoft Visual C++ 6.0标准版不支持静态链接到MFC库。解决方法为使用动态链接到MFC库。具体操作为:1.>打开您的 "Project"。 2.>从 "Project" 菜单中单击 "Settings"。 3.>在 "Setting for", 选择 "All configura
svn忽略maven的配置 1.编辑客户端的~/.subversion/config(*unix系统,windows可能不一样)文件,找到倍注释掉的global-ignores配置,改成需要的,如:global-ignores= .settings .project .classpath target .DS_Store
centos建立ftp 1、yum -y install vsftpd2、将 /etc/vsftpd/user_list文件和/etc/vsftpd/ftpusers文件中的root这一行注释掉 # root 3、执行以下命令 root>setsebool -P ftpd_disable_trans=1orsetsebool ftpd_home_dir on修改/etc/vsftpd/vsft
从docx提取专利文献数据 package cn.ac.ict.word;import java.io.File;import java.io.FileInputStream;import java.io.FileOutputStream;import java.util.ArrayList;import java.util.HashMap;import java.util.List;import java.
what changes in lucene4 Pre-3.0 indices are no longer supported. MIGRATE.txt describes how to update your application code. The index format won't change (unless a serious bug fix requires it) between this release an
正确理解ThreadLocal //traceback:http://www.iteye.com/topic/103804首先,ThreadLocal 不是用来解决共享对象的多线程访问问题的,一般情况下,通过ThreadLocal.set() 到线程中的对象是该线程自己使用的对象,其他线程是不需要访问的,也访问不到的。各个线程中访问的是不同的对象。 另外,说ThreadLocal使得各线程能够保持各自独立的一个对
html转化生成dom /* * Copyright 2002-2009 Andy Clark, Marc Guillemot * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You
shell for循环 #!/bin/bashcleari=1while(($i < 9))doecho $icrf_test -m cv.all.wd_pos_score.model ${i}.0.txt >> ${i}.0.test.wd_pos_score.txt && ./stat_word.py ${i}.0.test.wd_pos_score.txt >> ${i}.0.kw.wd_pos_sc
计算信息增益(Information Gain),考虑交叉feature package com.lexcotech.utils;import java.io.BufferedReader;import java.io.FileReader;import java.util.ArrayList;import java.util.Collections;import java.util.Comparator;import java.util.HashMap;
计算熵 package com.lexcotech.utils;import java.util.Arrays;import java.util.HashMap;import java.util.List;import java.util.Map;import java.util.Map.Entry;public class InformationGain { /** * calc
文件分割,用于将一个文件产生k份文档(仿linux的split,考虑遇到空行再分开) #!/usr/bin/pythonimport sys,os,commandsif __name__=='__main__': if len(sys.argv)==4 and sys.argv[1]=='help': print 'usage:*.py file2seg num_file des_folder' else: #get tota
产生K-folder交叉验证的代码 static void genKFolder(String CVFolder) { try { // String[] files = { "1.0.txt", "2.0.txt", "3.0.txt", "4.0.txt", // "5.0.txt", "6.0.txt", "7.0.txt", "8.0.txt", "9.0.txt", // "10.0.txt" };
CRF测试语料中统计准确度(最后两列是正确label与预测label) #!/usr/bin/pythonfrom __future__ import divisionimport sys,os,timeif __name__=='__main__': f=open(sys.argv[1],'r') total=0 right=0 for line in f: if len(line.strip()
relang入门 http://www.blogjava.net/killme2008/archive/2007/06/13/123860.html读erlang.org上面的Erlang Course四天教程1.数字类型,需要注意两点1)B#Val表示以B进制存储的数字Val,比如7> 2#101.5二进制存储的101就是10进制的5了2)$Char表示字符Char的asc
emacs plus erlang 1.download erlang from its website2../configure & make & sudo make install3.quick tip for emacs:c+x c+s:save file;c+x c+c: exit from emacs4.program the first erlang(test.erl):-module(test).-e
xcode 4.3破解 基本方法参照网易的一个帖子:http://kqwd.blog.163.com/blog/static/4122344820117191351263需要修改的包括:1.使用sudo进行操作 2.将/Developer修改为/Applications/Xcode.app/Contents/Developer最后附上我的run script(注意那个py文件的名称与位置):export
黑苹果 联想Y460在Win7下安装iATKOS L2 入门级教程-远景-windows7,windows8,旗舰版,系统下载,主题卡住的解决方法1.-f -v查看停在了哪一步2.-s -v: /sbin/fsck -fy /sbin/mount -uw / chmod -R 755 mach_kernel chow
解决iphone4无法格式化号码的问题 /System/Library/Frameworks/UIKit.framework/PhoneFormats/UIMobileCountryCodes.plist加入代码: 001 cn
xshell连接centos乱码 [文件]–>[打开]–>在打开的session中选择连接的那个,点击properties -> [Terminal ],在右边的translation先选择utf8,然后重新连接服务器即可。
科技界高管励志名言:成功需要纯粹毅力 北京时间2012年1月16日晚间消息,美国科技博客BusinessInsider今天选出了科技界成功人士的励志名言。其中,乔布斯的“纯粹毅力论”高举榜首。 1.苹果联合创始人史蒂夫•乔布斯(Steve Jobs)——毅力 “我深信企业家是否能成功有一半因素在于是否拥有纯粹的毅力。” 2.PayPal前首席技术官(CTO)麦克斯•莱夫钦(Max Levchin)——坚持
关于铁道部的那点事 1.对火车购票网的登录页面的分析http://user.qzone.qq.com/386861941/blog/1326166461最近很多人经历了比较痛苦的网上购票,有人叹其为2012最慢的网站。为什么会这么慢?我同意很多业内人士的看法,除了管理方面的问题, 网站的设计存在一些重要的问题,第一是购票流程可能不是很科学,从而增加了系统的复杂性和数据锁定(lock)的几率,使得很多人
删除chrome添加应用程序快捷菜单 cd ~/.local/share/applications/rm -rf chrome-http___support.google.com_chrome_bin_answer.py_hl\=zh-Hans\&answer\=95710.desktop
python攻击代码 # -*- coding: UTF-8 -*-import urllib, urllib2, cookielibimport random, string myCookie = urllib2.HTTPCookieProcessor(cookielib.CookieJar())openner = urllib2.build_opener(myCookie) while True:
openssh进入iphone >ssh root@iphone-ip>alpineJobsmato-iPhone:~/Library root# uname -a Darwin Jobsmato-iPhone 11.0.0 Darwin Kernel Version 11.0.0: Tue Nov 1 20:33:58 PDT 2011; root:xnu-1878.4.46~1/RELEASE_ARM_S5L8
反汇编之路 1.使用objdump查看:objdump -dS 222.exe;显示为pei-i386程序2.使用peid查看壳,以及壳的类型:aspack2.1的壳3.使用AspackDie进行去壳操作,done4.再次使用peid查看编码的语言:delphi7,去!5.使用DeDe进行反汇编,save到dumps文件夹6.安装delphi7,天空还有。7.看吧,亲!
moses跑机器翻译 1.工作环境:Centos6.1_X86_64,四核2.0GHz,内存4GB,交换内存30G,linux内核版本2.6.32-131.21.1.el6.x86_642.准备工作2.1建立目录1srilm,2gizapp,3moses,4data,5backup,6bin,7model,8tuning2.2下载程序moses:https://nodeload.github.com/m
非监督学习的tasks 1。聚类 clustering, where the goal is to separate the n instances into groups; 2。离群点检测novelty detection, which identifies the few instances that are very different from the majority; 3。维度削减 dimensio
去掉gmail右部和底部的广告 // ==UserScript==// @name remove the gmail ad// @namespace qibaoyuan// @description 1. 去右侧广告 2.去除底部广告// @author ytzong// @homepage http://userstyles.org/styles/15631//
Linux修改主机名 1.hostname修改主机名 hostname ahuang.org 2.修改/etc/hosts文件 vim /etc/hosts 内容大致如下: 127.0.0.1 localhost.localdomain localhost 173.255.246.150(实际IP) ahuang.org ahuang 3.修改/et
shell test [qibaoyuan@localhost shell]$ man test>> man.txt[qibaoyuan@localhost shell]$ man test [qibaoyuan@localhost shell]$ cat man.txt TEST(1) User Commands
原来都支持64位 在windows下用cpuz发现支持64位;在linux下用/propc/cpuinfo发现支持lm(long mode),于是,它俩变成了64位的。以前一直认为只支持32位的指令,现在好了,全部重新安装操作系统,装64位的啦。
centos6安装ktorrent 1.安装epel:http://download.fedora.redhat.com/pub/epel/6/i386/epel-release-6-5.noarch.rpm2.sudo yum repolist3.sudo yum install ktorrent
ibus安装搜狗的词库 1.下载:http://hslinuxextra.googlecode.com/files/sougou-phrases-full.7z2.解压缩得到android.db3. sudo cp /home/qibaoyuan/download/sougou-phrases-full/ibus/android.db /usr/share/ibus-pinyin/db/
Linux多线程编程(不限Linux) ///http://www.cnblogs.com/skynet/archive/2010/10/30/1865267.html前言线程?为什么有了进程还需要线程呢,他们有什么区别?使用线程有什么优势呢?还有多线程编程的一些细节问题,如线程之间怎样同步、互斥,这些东西将在本文中介绍。我在某QQ群里见到这样一道面试题:是否熟悉POSIX多线程编程技术?如熟悉,编写
内存不够伤不起 内存6G,耗干净;交换内存6G,耗干净。伤不起啊。1、增加2G的交换分区[root@localhost ~]#mkdir /root/swap2、添加交换文件并设置其大小为2G,使用如下命令[root@localhost ~]# dd if=/dev/zero of=/root/swap/swap bs=1024 count=2048000读入了 20480
(转)centos6安装stardict -==============-安装rpmforge、epel后:sudo yum install stardict* -y-=============-源里面没有这个东西,但是这个东西貌似必不可少。开始想从源代码编译,失败了n次,从2.4.2弄到3.0.3,全部失败,修改代码也搞不定。找到了一个rpm包,可以直接安装的,舒服了很多。下载链接:
Matlab for Linux中文乱码 Matlab中文乱码的原因是它的图形界面是用java写的,换句话说,我们要做的实际上就是搞定java的中文显示。1. 首先找到并进入自己的JRE目录。 我自己的是:/usr/local/MATLAB/R2010b/sys/java/jre/glnx86/jre/,大家需要根据自己的安装目录和matlab版本来确定。2. 在/usr/local/matlab/sys/
centos CR repo 在centos 6.1发布之前,centos临时发布了CentOS 6.0 CR Repo,有需要的可以下载用于CENTOS 6.0,同时也说明centos 6.1可能会再次跳票(大家都习惯了吧!)# yum install centos-release-cr# yum update