自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(57)
  • 收藏
  • 关注

转载 webpack起服务器报JavaScript heap out of memory

配置如下:{ "scripts": { "start": "node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --progress --port 3000 --open" }}用本地js起服务,不用全局...

2018-07-17 15:11:00 211

转载 linux中service模板

[Unit]Description=描述After=syslog.target network.target remote-fs.target nss-lookup.target [Service]Type=simpleWorkingDirectory=程序路径User=rootExecStart=/bin/sh -c "exec 执行程序(例:npm...

2018-06-27 10:22:00 351

转载 sqlite3中给表添加列

1、修改表名为临时表ALTER TABLE {tableName} RENAME TO TempOldTable;2、创建新表,跟原来的表名一致CREATE TABLE {tableName} (name TEXT, COLNew {type} DEFAULT {defaultValue}, qty INTEGER, rate REAL);3、填充原来的数...

2018-06-20 16:03:00 1709

转载 webpack打包后服务端__dirname失效问题

在webpack.config.js中添加如下配置:target: 'node',node: { __dirname: false, __filename: false,}详见:https://github.com/webpack/webpack/issues/1599转载于:https://www.cnblogs.com/demonr...

2018-05-25 17:07:00 476

转载 nodejs查看本机hosts文件域名对应ip

const dns = require('dns')dns.lookup('domainName', function(err, result) { console.log(result)})related:https://stackoverflow.com/questions/36689536/how-to-resolve-hostname-to-an-...

2018-04-24 20:33:00 1187

转载 vscode远程调试node服务端

{ "type": "node", "request": "attach", "name": "调试名称", "address": "远程调试IP地址", "port": 端口号, "localRoot": "$...

2018-04-24 19:35:00 144

转载 git 删除错误commit

其实就是硬reset到之前对的commit记录然后强行再推送到远程库一下具体操作:git reset --hard <commit_id>git push origin HEAD --force转载于:https://www.cnblogs.com/demonrain/p/8872821.html...

2018-04-18 11:01:00 86

转载 npm安装模块没有权限解决办法

直接加上unsafe的参数即可sudo npm install --unsafe-perm --verbose -g sails转载于:https://www.cnblogs.com/demonrain/p/8779496.html

2018-04-10 15:31:00 666

转载 node gyp编译所需要的环境

安装ms的build工具包,自带pythonnpm install --global --production windows-build-tools转载于:https://www.cnblogs.com/demonrain/p/8778953.html

2018-04-10 14:47:00 157

转载 npm和yarn的淘宝镜像添加

npm config set registry https://registry.npm.taobao.orgnpm config set disturl https://npm.taobao.org/distnpm config set electron_mirror https://npm.taobao.org/mirrors/electron/npm config ...

2018-03-14 15:54:00 2487

转载 for循环中使用async/await

async function printFiles () { const files = await getFilePaths(); await Promise.all(files.map(async (file) => { //耗时操作 const contents = await fs.readFile(file, 'utf8') ...

2018-03-01 09:30:00 2137

转载 在vscode中进行nodejs服务端代码调试(代码修改自动重启服务端)

使用到的是nodemon,具体在package.json文件中配置如下:"scripts": { "start": "node ./bin/www", "debug": "nodemon --inspect ./bin/www"}主要是需要有--inspect参数然后在vscode中添加lauch.json的配置:{ "ver...

2018-02-13 13:58:00 957

转载 electron中引入jquery

<!-- Insert this line above script imports --><script>if (typeof module === 'object') {window.module = module; module = undefined;}</script><!-- normal script import...

2018-01-17 09:25:00 514

转载 git生成ssh公私钥

ssh-keygen -t rsa -C "youremail@example.com"生成好的密钥文件在%userprofile%/.ssh/目录,.pub文件为公钥,然后添加到github或者gitlab的个人ssh的key就可以。ssh-keygen -t rsa -C "youremail@example.com"转载于:https://www.cnblogs...

2017-12-21 15:46:00 81

转载 require sqlite3时报The specified module could not be found.错误

http://dependencywalker.com/在这个站点下载对应平台的Dependency Walker,打开你自己编译好的.node文件(sqlite3\lib\binding\node-webkit-vXXversion-XXplatform-XX\node_sqlite3.node),看提示缺少的dll,把缺少的dll放入.node文件同级目录即可。详见:ht...

2017-12-07 17:11:00 316

转载 windows下递归删除指定文件和文件夹

//删除文件del *.后缀 /s//删除文件夹for /r 目录 %a in (文件夹名\) do @if exist "%a" rd /s/q "%a"转载于:https://www.cnblogs.com/demonrain/p/7904967.html

2017-11-27 16:58:00 1118

转载 vscode源码启动时需要的electron缓存位置

C:\Users\Administrator\AppData\Local\Temp\gulp-electron-cache可以把下好的electron release直接放到这个目录,就不用重新下了。转载于:https://www.cnblogs.com/demonrain/p/7478390.html...

2017-09-05 14:09:00 561

转载 vscode 输出面板字符编码问题

默认的输出中文会显示成乱码,需要在vscode内部的终端中输入chcp 65001缺点是需要每次打开vscode进行激活,另一种方式是在vscode的首选项中进行配置:"terminal.integrated.shellArgs.windows": ["/K", "chcp 65001"](无效请尝试以下配置)"terminal.integrated.shellA...

2017-08-30 16:20:00 352

转载 vscode源码编译疑难问题

最近把原来老的源码merge到了新的1.15版本源码,以前的依赖问题会导致各种错误,Loading "gc-signals" failed啦,Error: %1 is not a valid Win32 application啦,google了一下,基本上的解决方法就是把依赖删除重新install一下就行了,然后发现这条命令,是把所有的依赖和out目录删除,在根目录运行即可。...

2017-08-25 16:02:00 181

转载 vscode安装依赖报错 TypeError: zipfile.readEntry is not a function

错误原因是npm的版本太高,需要把5.x的版本换回4.x的npm install npm@4 -g 或者cnpm install npm@4 -g详见:https://github.com/Microsoft/vscode/issues/30775转载于:https://www.cnblogs.com/demonrain/p/7418421.html...

2017-08-23 15:30:00 246

转载 从package.json中获取属性

var pjson = require('./package.json');console.log(pjson.version);详见:https://stackoverflow.com/questions/9153571/is-there-a-way-to-get-version-from-package-json-in-nodejs-code转载于:https:...

2017-08-03 19:17:00 819

转载 多git项目中账户的管理

每个项目配置用户名:git config user.name "your_name"git config user.email "your_email"如果不配置则使用默认的全局用户名//配置git config --global user.name "your_name"git config --global user.email "your_em...

2017-08-02 10:06:00 64

转载 file控件选择同一文件不触发change事件和img控件不改变src的情况下图片不刷新问题解决...

最近跑来前端掺和了。。file控件的问题用inputFile.value = '';img控件的问题,在图片后面添加一串无意义的参数即可,例如:img.src = 'file:///' + 本地图片路径+ '?t=' + Math.random();转载于:https://www.cnblogs.com/demonrain/p/7066182.h...

2017-06-22 17:27:00 162

转载 sublimetext插件自定义respository

官方文档(https://packagecontrol.io/docs/submitting_a_package)上面说明了插件可以按两种方式挂起,一种是github,一种是ssl认证的web服务器官方给了个例子(https://raw.githubusercontent.com/wbond/package_control/master/example-repository.js...

2017-02-27 17:02:00 387

转载 tableviewer自动调整列宽

public void resizeTableColumn(TableColumn[] treeColumns) { for (TableColumn tc : treeColumns) tc.pack(); }在setinput后用,其实就是调用的pack方法。转载于:https://www.cnblogs....

2016-11-18 14:40:00 280

转载 eclipse p2更新官网wiki的例子

官网的cvs好像没了,不过在github上找到一份,可用。https://github.com/anthonydahanne/make-p2-buildable-with-tycho/tree/master/examples/org.eclipse.equinox.p2.examples.rcp.cloud转载于:https://www.cnblogs.com/demonrain...

2016-10-18 19:12:00 93

转载 打包完的rcp产品svn不储存密码问题

原因是缺少org.eclipse.core.runtime.compatibility.auth这个依赖,需要添加到依赖中去因为使用SVNKit的时候会去调eclipse这个api详情见:http://subversion.1072662.n5.nabble.com/SVNKit-within-Eclipse-not-storing-passwords-td175926.ht...

2016-07-20 11:28:00 81

转载 hudson 使用节点打包出现ClassNotFoundException: org.jvnet.hudson.maven3.agent.Maven3Main 错误...

java.lang.NoClassDefFoundError: org/jvnet/hudson/maven3/agent/Maven3MainCaused by: java.lang.ClassNotFoundException: org.jvnet.hudson.maven3.agent.Maven3Mainat java.net.URLClassLoader$1.run...

2016-07-15 16:51:00 264

转载 maven 安装第三方jar到本地 出现 The goal you specified requires a project to execute but there is no POM in thi...

原因是因为操作系统的差异导致,把所有参数加上引号即可。如下所示:mvn install:install-file "-Dfile=cobra.jar" "-DgroupId=com.cobra" "-DartifactId=cobra" "-Dversion=0.98.4" "-Dpackaging=jar" "-DgeneratePom=true"详见http...

2016-07-15 16:37:00 828

转载 利用tycho插件自动生成pom文件

mvn org.eclipse.tycho:tycho-pomgenerator-plugin:generate-poms -DgroupId=com.vogella.tychoexamplecom.vogella.tychoexample就是你的groupid更新命令为:mvn org.eclipse.tycho:tycho-versions-plugin:upda...

2016-07-06 15:49:00 179

转载 -Dmaven.multiModuleProjectDirectory system property is not set. Check $M2_HOME environment variable ...

出这个错是因为jdk没有设置Dmaven.multiModuleProjectDirectory这个参数如下配置即可:转载于:https://www.cnblogs.com/demonrain/p/5646759.html

2016-07-06 14:19:00 71

转载 tycho 打包编译报错 Access restriction: The type XYZ is not API

解决办法:在pom.xml中加入以下配置<plugin> <groupId>org.eclipse.tycho</groupId> <artifactId>tycho-compiler-plugin</artifactId> <version>${tycho.version}...

2016-07-05 16:46:00 122

转载 jaxb读有BOM的XML文件问题

一开始找了半天没找到什么原因,读文件就报错:Content is not allowed in prolog后来发现是文件是UTF-8带BOM和不带BOM的问题问题就好解决了,直接读带BOM文件的时候去掉第一个字符就解决了。StringReader reader = new StringReader(xml.substring(1));return (T) ...

2015-11-24 14:25:00 97

转载 jaxb生成cdata块

1、需要添加一个适配器:import javax.xml.bind.annotation.adapters.XmlAdapter;public class AdapterCDATA extends XmlAdapter<String, String>{ @Override public String marshal(String a...

2015-11-19 18:01:00 115

转载 eclipse 编辑器 setDirty方法无效

可能是因为使用的编辑器继承了FormPage导致的,在setDirty方法里面多加一行getManagedForm().dirtyStateChanged();就可以了。转载于:https://www.cnblogs.com/demonrain/p/4972186.html...

2015-11-17 16:43:00 89

转载 使用jaxb用xsd生成java类

命令: xjc -p 包的路径 xsd的名字.xsd -d 目标的文件夹具体详细见:http://www.iteye.com/topic/1118082转载于:https://www.cnblogs.com/demonrain/p/4969564.html

2015-11-16 17:32:00 309

转载 EMF保存CDATA

/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated NOT */ public String getCDATA() { String str = (String)getMixed().get(Pa...

2015-09-21 14:56:00 78

转载 windows builder里面的可伸缩面板

使用org.eclipse.wb.core.controls.flyout.FlyoutControlComposite.FlyoutControlComposite类构造方法中传入的preferences为org.eclipse.wb.core.controls.flyout.IFlyoutPreferences具体创建方法为:IFlyoutPreferen...

2015-09-16 10:06:00 106

转载 使用eclipse open type对话框

需要依赖jdt的相关插件(ui和core)具体调用方法:Shell parent= JavaPlugin.getActiveWorkbenchShell();OpenTypeSelectionDialog dialog= new OpenTypeSelectionDialog(parent, false,PlatformUI.getWorkbench().getPro...

2015-09-16 09:48:00 412

转载 eclipse中toolbar位置的系统URI

org.eclipse.ui.ide.IIDEActionConstants这个类里存了系统toolbar,菜单等URI定义自己的toolbar或者menu时,指定位置after=additions,additions可以改为相应的值。转载于:https://www.cnblogs.com/demonrain/p/4629751.html...

2015-07-08 11:53:00 123

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除