bundle

How to get a bundle-object returned by a service out of the Equinox framework - java.lang.LinkageError

巧了我就是萌 提交于 2020-01-16 16:47:09
问题 I have a class which runs an Equinox framework. Now I would like to get an Object (defined in one of the bundles) that is returned by a service out of the framework. Unfortunately, I get a LinkageError and have no idea how to get rid of it. Is it even possible to let a service return a proper object to non-bundle code? Here is the full story: ParserDTOBundle is a bundle that defines the class ParserDTO and exports the corresponding package. In another bundle, ParserServiceBundle, I define a

Symfony2.3, How to register a 3rd party bundle in Kernel, and load it from a Controller?

痴心易碎 提交于 2020-01-16 04:06:06
问题 I would like to get some help with symfony2 regarding the bundle registration in the Kernel, Ive read most of symfony2 cookbook and doc for exemple : How to install 3rd party Bundles But yet everytime I failed doing so. I am using symfony 2.3 with composer, both up to date. Today I would like to use a 3rd party bundle called "google/apiclient" found on packagist.org, therefor i add the following line "google/apiclient": "dev-master" to my composer.json file which is located at the root of my

React-Native android在windows下的踩坑记

有些话、适合烂在心里 提交于 2020-01-16 01:15:41
1.执行node命令时提示: node 不是内部或外部命令,也不是可运行的程序或批处理文件。 原因环境变量没有指向node安装目录 path:C:\Program Files\nodejs\ 2.react-native环境搭建完成,执行初始化命令时 react-native init reactNativeDemo 没任何反应,提示错误信息: react-native不是内部或 外部命令,也不是可运行的程序或批处理文件。 搞了半天是因为path环境变量不对,由于我把node_cache和node_global放到了和nodejs安装目录(C:\Program Files\nodejs)不同的目录(D:\nodejs)中,所以环境变量必须要做相应的修改。 (避免不必要的麻烦,不要修改默认安装目录) 环境变量:NODE_PATH:D:\nodejs\node_global      Path:D:\nodejs\node_global;D:\nodejs\node_global\node_modules 参考博客: React-Native开发之BUG 总结 React-Native android在windows下的踩坑记 3.执行 react-native run-android 命令出错: BUILD FAILED Could not install the app on

React Native

隐身守侯 提交于 2020-01-15 17:06:29
React Native 安装 配置好 node 环境 npm install -g react-native-cli 运行项目 react-native init yourproject --version 0.44.3 注意: 当前的工作目录下要没有 yourproject 目录; 一定要加上 --version 0.44.3 , 如果不加上去默认是生成最新版本的工程, 老的电脑可能因为报错而无法运行; 如果你使用的 zsh 安装的 node, 那么请在系统自带的 Terminal 中设置启动的 shell 为登录 shell, 因为 react-native 的一些操作需要打开 Terminal 执行 node相关命令, 主要就是执行 package.sh , 否则模拟器会出现 bundle 之类的错误; 也可以尝试一下 react-native bundle --entry-file index.js --bundle-output ./ios/bundle/index.ios.jsbundle --platform ios --assets-dest ./ios/bundle --dev false cd yourproject react-native run-ios 常用组件 获取屏幕像素 import { Dimensions } from 'react

ASP.Net MVC 5 - Deploy separate CDN site with bundled JavaScript and CSS

孤者浪人 提交于 2020-01-15 16:52:14
问题 I was wondering whether it is possible to deploy two ASP.Net MVC sites to do the following. Main Website: contains all the controllers and views CDN website: contains all the JavaScript and CSS (bundles JS and CSS that is consumed by the first site) I was expecting that in the solution you would have two website projects. I think in debug mode this would work fine because the bundle names are consistent. However, in production where you are not running in debug mode (turned off in web.config)

ASP.Net MVC 5 - Deploy separate CDN site with bundled JavaScript and CSS

人盡茶涼 提交于 2020-01-15 16:49:06
问题 I was wondering whether it is possible to deploy two ASP.Net MVC sites to do the following. Main Website: contains all the controllers and views CDN website: contains all the JavaScript and CSS (bundles JS and CSS that is consumed by the first site) I was expecting that in the solution you would have two website projects. I think in debug mode this would work fine because the bundle names are consistent. However, in production where you are not running in debug mode (turned off in web.config)

block in replace_gem can't activate bcrypt-ruby (~> 3.0.0), already activated bcrypt-ruby-3.1.1

房东的猫 提交于 2020-01-15 12:33:11
问题 I've looked at several answers regarding this problem and none seem to do the trick. This is on windows and I am lost for ideas. Thanks for the help! C:/Ruby200/lib/ruby/gems/2.0.0/gems/bcrypt-ruby-3.0.1-x86-mingw32/lib/bcrypt_ext.rb:2:in require': cannot load such fil e -- 2.0/bcrypt_ext (LoadError) from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bcrypt-ruby-3.0.1-x86-mingw32/lib/bcrypt_ext.rb:2:in ' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/bcrypt-ruby-3.0.1-x86-mingw32/lib/bcrypt.rb:12:in `require

安卓调用系统摄像头和相册,以及裁剪图片

巧了我就是萌 提交于 2020-01-15 07:40:11
1、调用系统摄像头 安卓中,调用系统摄像头其实很简单,只要通过创建一个action为android.media.action.IMAGE_CAPTURE的意图 ,然后再调用Intent的putExtra()方法指定图片的输出地址,最后再调用startActivityForResult()来启动活动。由于 我们使用的是一个隐式意图,系统会找到能够响应这个Intent的活动去启动,这样照相机程序就会打开,拍下的照片就会 输出到我们指定的位置。 File outputImageFile = new File(Environment.getExternalStorageDirectory(), "output_image.jpg"); try { if (outputImageFile.exists()) { // 如果这个文件存在的话 outputImageFile.delete(); } outputImageFile.createNewFile(); } catch (IOException e) { e.printStackTrace(); } imageUri = Uri.fromFile(outputImageFile); Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra

RN bundle自动化静态扫描

梦想与她 提交于 2020-01-15 01:42:18
背景 起因是在排查公寓找室友bundle过大问题时,发现house-middle-sdk体积异常,逐个删减引用得出结论是引用了node-forge库导致,通过这次手动排查经历演化出做一个bundle自动化静态扫描的想法。 介绍 安装 npm i house-cli -g 使用 根目录添加metro.config.js文件 //里面引用全局路径(这个后面优化一下) module.exports = require('/Users/haojie/WorkSpace/house-cli/scripts/index.js') house-explorer 功能点 输出 bundle总大小、按包统计模块大小并显示百分比、按包输出所有js文件的module文件 原理 基于metro的Serialization环节捕获到每个module,然后将其分析。原本打算侵入源码分析,但难度过大,因为涉及到react-native-cli以及react-native和metro源码的调用,所以最后折中采取在processModuleFilter环节分析的做法。缺陷在于目前没有做包的依赖库分析。 公寓找室友扫描结果分析 左侧为公寓数据、右侧为找室友数据 从分析数据来看总bundle大小相差200kb,业务代码均占比很高基本在40%或以上,把node-forge库优化后业务代码占比会更高

集成算法之Light GBM

烈酒焚心 提交于 2020-01-14 19:51:04
一、Light GBM Light GBM是和xgboost类似的一种集成算法。xgboost算法的一个瓶颈是针对每个特征,它都需要对每一个可能的分裂点扫描全部的样本来计算基尼系数,这样大大增加了计算量,降低了算法效率。为了解决这种在大样本高纬度数据的环境下耗时的问题,Light GBM算法使用直方图方法在牺牲一定精度的条件下,换取计算速度的提升和内存的消耗;主要使用如下两种方法:一是GOSS(Gradient-based One-Side Sampling, 基于梯度的单边采样),不是使用所用的样本点来计算梯度,而是对样本进行采样来计算梯度;二是EFB(Exclusive Feature Bundling, 互斥特征捆绑) ,这里不是使用所有的特征来进行扫描获得最佳的切分点,而是将某些特征进行捆绑在一起来降低特征的维度,是寻找最佳切分点的消耗减少。这样大大的降低的处理样本的时间复杂度,但在精度上,通过大量的实验证明,在某些数据集上使用Lightgbm并不损失精度,甚至有时还会提升精度。 二、直方图算法(Histogram-based Alogrithm) 直方图优化算法需要在训练前预先把特征值转化为bin,也就是对每个特征的取值做个分段函数,将所有样本在该特征上的取值划分到某一段(bin)中,最终把特征取值从连续值转化成了离散值。 第一个 for