我想安装的最新版本NodeJS
上Ubuntu Zesty 17.04
.但无论是使用apt-get还是尝试从nodesource ppa下载它,我总是拥有版本4.7.2.
apt-get的
sudo apt-get update
sudo apt-get install nodejs npm
Run Code Online (Sandbox Code Playgroud)
节点PPA
curl -sL https://deb.nodesource.com/setup_6.x | sudo bash -
sudo apt-get update
apt-get install nodejs npm
Run Code Online (Sandbox Code Playgroud)
结果
$> node -v
v4.7.2
Run Code Online (Sandbox Code Playgroud)
我怎样才能获得NodeJS的6.9版本?
我正在使用MessageSource
Spring从.properties
类路径中的文件加载错误消息.我的属性尊重某个"模板",例如{Object}.{field}.{unrespectedConstraint}
:
userRegistrationDto.password.Size= Le mot de passe doit avoir au minimum 6 caractères.
userRegistrationDto.email.ValidEmail= Merci de saisir une addresse mail valide.
Run Code Online (Sandbox Code Playgroud)
在重构的情况下(例如,更改类的名称),我必须在几个地方更改我的属性文件.
有没有办法使用yaml文件(messages.yml)作为ResourceBundle来获取类似的东西:
userRegistrationDto:
password:
Size: Le mot de passe doit avoir au minimum 6 caractères.
email:
ValidEmail: Merci de saisir une addresse mail valide.
Run Code Online (Sandbox Code Playgroud) 我一直在努力尝试在我使用的Angular 2项目中制作googlemaps 工作几个小时.PlaceResult
Angular-cli
我必须googlemaps
使用@types 进行安装并将其添加到配置文件的属性"types"
下tsconfig.json
.
{
...
"types": [
"google-maps"
]
}
}
Run Code Online (Sandbox Code Playgroud)
我google.maps.places.PlaceResult
只需导入它即可成功使用我的Angular 2 Component!
import { ActivatedRoute, Params } from "@angular/router";
import { MapsAPILoader } from "angular2-google-maps/core";
import PlaceResult = google.maps.places.PlaceResult;
import GeocoderRequest = google.maps.GeocoderRequest;
...
Run Code Online (Sandbox Code Playgroud)
几个小时之后,我不得不一起工作google.maps.Marker
,它与PlaceResult
和的定义文件相同GeocoderRequest
.所以我只需将其导入如下:
[Line 12] import PlaceResult = google.maps.places.PlaceResult;
[Line 13] import GeocoderRequest = google.maps.GeocoderRequest;
[Line 14] import Marker = google.maps.Marker;
[Line 15] import LatLng = google.maps.LatLng; …
Run Code Online (Sandbox Code Playgroud) google-maps typescript angular-cli angular2-google-maps angular
我已经在网上完成了其他问题,我觉得我的不同,足以保证一个新的问题.
所以我有一个Centos 6 box
,为我运行一个小网站,充当办公室git服务器,我正在尝试配置Python3
它.
所以我按照以下步骤python3
在服务器上进行了设置.但似乎我无法将paramiko导入我的脚本.
我下载了paramiko rpm然而我得到这条消息:
当我尝试导入paramiko时,我得到:
[root@GIT Python-3.4.2]# rpm -ivh /usr/lib/Python-3.4.2/Modules/python-paramiko-1.7.5-2.1.el6.noarch.rpm
Preparing... ########################################### [100%]
package python-paramiko-1.7.5-2.1.el6.noarch is already installed
Run Code Online (Sandbox Code Playgroud)
当我直接运行python3时:
[root@GIT inserv_health_check]# python3
Python 3.4.2 (default, Jan 21 2015, 06:28:04)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import paramiko
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'paramiko'
>>>
Run Code Online (Sandbox Code Playgroud)
我确信这个问题有一个简单的解决方案,也许路径是错误的,或者我应该在某个地方放置一个符号链接.任何帮助,将不胜感激 :)
在有人询问之前,哪个python输出:
[root@GIT …
Run Code Online (Sandbox Code Playgroud) 我正在尝试构建一个continuous-integration
平台,并在 a 中Ansible
playbook
使用maven-dependency-plugin:get
来从masterNexus
上的a 下载工件,该工件将使用module部署在远程服务器上。Ansible
copy
为了制作一个轻量级和通用的剧本,我定义了一个名为的变量app_version
,如果定义了,我下载给定的版本,如果没有,我从存储库下载最新版本Nexus
。工件下载到给定目录 ( /tmp/delivery/
) 中。在我的Ansible
任务下面:
- hosts: local
tasks:
- name: "Downloading the war"
shell: >
mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:get -DgroupId=App-DartifactId=App-Dversion={{ app_version if app_version is defined else 'LATEST' }} -Dpackaging=war -DrepositoryId=my-nexus -Ddest=/tmp/delivery/
Run Code Online (Sandbox Code Playgroud)
为了确保剧本的通用性,我需要在Ansible
模块中编写一个正则表达式copy
来选择具有该模式的工件,app*.war
但该模块似乎不提供此功能。在我的复制任务下方:
- hosts: agir
tasks:
- name: "Copying the war"
copy: src=/tmp/delivery/app*.war dest=/folder/app.war owner=user group=group mode=0755
Run Code Online (Sandbox Code Playgroud)
如何在模块中使用正则表达式copy …
我有以下Angular Route配置
const appRoutes: Routes = [
{
path: '',
component: DirectoryComponent
},
{
path: 'manage/:type/:id',
component: ManageComponent,
outlet: 'manage',
children: [
{
path: '',
component: PreviewComponent,
pathMatch: 'full'
},
{
path: 'add/:elementType',
component: EditComponent,
}
]
}
];
Run Code Online (Sandbox Code Playgroud)
ManageComponent
是一个沙箱组件PreviewComponent
,EditComponent
将在其中呈现.
用户用例重定向http://localhost:4200/#/(manage:manage/bar/12762)
与预览组件匹配的用户.一切都还可以.
从PreviewComponent
当上一个按钮,用户点击,我希望做一个相对导航的EditComponent
有,当导航结束,http://localhost:4200/#/(manage:manage/bar/12762/add/foo)
我试过了
this.router.navigate([{outlets: {manage: ['add', 'foo']}}],{relativeTo: this.route});
Run Code Online (Sandbox Code Playgroud)
和
this.router.navigate([{outlets: {manage: ['add', 'foo']}}]);
Run Code Online (Sandbox Code Playgroud)
但每次,用户都被重定向到http://localhost:4200/#/add/foo
.
我有Angular 5
一个默认语言法语的应用程序.我必须添加需要更改全局布局的阿拉伯语(必须从右到左显示内容......).
我想知道是否有一种方法只使用一个组件并进行条件模板选择.例如 :
--my-compenent_ar.html
--my-compenent_fr.html
--my-component.ts
And in my @Component({
moduleId: module.id,
templateUrl: ==> condition here
styleUrls: ['./sign-in.component.scss']
})
export class MyComponent
Run Code Online (Sandbox Code Playgroud)
当前版本的Angular(5)本身不支持这种情况.
有什么好办法吗?
我想要做的是
--my-compenent_ar.html
--my-compenent_fr.html
--my-component.ts
--my-component.ar.ts
@Component({
moduleId: module.id,
templateUrl: './my-compenent_fr.html'
styleUrls: ['./sign-in.component.scss']
})
export class MyComponent {
....
}
@Component({
moduleId: module.id,
templateUrl: './my-compenent_ar.html'
styleUrls: ['./sign-in.component.scss']
})
export class MyComponentAR extends MyComponent {}
Run Code Online (Sandbox Code Playgroud)
使用此配置,FR
语言环境将导航到MyComponent
并定位AR
到MyComponentAR
.
这很冗长.你有干净的方法吗?
我正在使用 Angular Universal 和 domino 在 Express 服务器上“伪造”DOM 服务器端。一切都工作正常,直到出现npm cache clean --forc
e,然后出现 anpm install
我收到以下错误:
\n\n/path/to/app/src/gui/dist/server/server.js:2378\n */(s),2))[0],l=i[1]),this.engine.listen(this.namespaceId,a,s,l,function(e){var t=e._data||-1;o.factory.scheduleListenerCallback(t,n,e)})}return this.delegate.listen(e,t,n)},t}(h);var g=function(e){function t(t,n,r){return e.call(this,t.body,n,r)||this}return Object(r.c)(t,e),t=Object(r.b)([Object(i.Injectable)(),Object(r.e)(0,Object(i.Inject)(l.DOCUMENT)),Object(r.d)("design:paramtypes",[Object,s.AnimationDriver,s["\xc9\xb5AnimationStyleNormalizer"]])],t)}(s["\xc9\xb5AnimationEngine"]);function v(){return Object(s["\xc9\xb5supportsWebAnimations"])()?new s["\xc9\xb5WebAnimationsDriver"]:new s["\xc9\xb5CssKeyframesDriver"]}function y(){return new s["\xc9\xb5WebAnimationsStyleNormalizer"]}function b(e,t,n){return new f(e,t,n)}var w=new i.InjectionToken("AnimationModuleType"),_=[{provide:a.AnimationBuilder,useClass:u},{provide:s["\xc9\xb5AnimationStyleNormalizer"],useFactory:y},{provide:s["\xc9\xb5AnimationEngine"],useClass:g},{provide:i.RendererFactory2\n\nTypeError: Right-hand side of \'instanceof\' is not an object\n at bt (/path/to/app/src/gui/dist/server/server.js:2378:180688)\n at yt (/path/to/app/src/gui/dist/server/server.js:2378:180563)\n at ir (/path/to/app/src/gui/dist/server/server.js:2378:203358)\n at We.insertToken (/path/to/app/src/gui/dist/server/server.js:2378:179949)\n at /path/to/app/src/gui/dist/server/server.js:2378:183251\n at kt (/path/to/app/src/gui/dist/server/server.js:2378:183266)\n at Xe (/path/to/app/src/gui/dist/server/server.js:2378:178211)\n at Object.parse (/path/to/app/src/gui/dist/server/server.js:2378:177177)\n at Object.t.createDocument (/path/to/app/src/gui/dist/server/server.js:2833:9750)\n at Object.t.createWindow (/path/to/app/src/gui/dist/server/server.js:2833:10129)\n
Run Code Online (Sandbox Code Playgroud)\n\n错误发生在domino的HTMLParser.js中,第2177行,位于以下几行:
\n\n …我正在使用MapStruct进行dto <-> entity
映射。相同的映射器用于从dto 创建 和 更新实体。完成dto的id验证以了解是否必须创建一个新实体(id == null)还是应该从数据库中检索它(id!= null)。
我实际上正在使用MapperDecorator作为解决方法。范例:
@Mapper
@DecoratedWith(UserAccountDecorator.class)
public interface UserAccountMapper {
UserAccountDto map(User user);
User map(UserAccountDto dto);
User map(UserAccountDto dto, @MappingTarget User user);
}
Run Code Online (Sandbox Code Playgroud)
public abstract class UserAccountDecorator implements UserAccountMapper {
@Autowired
@Qualifier("delegate")
private UserAccountMapper delegate;
@Autowired
private UserRepository userRepository;
@Override
public User map(UserAccountDto dto) {
if (dto == null) {
return null;
}
User user = new User();
if (dto.getId() != null) {
user = …
Run Code Online (Sandbox Code Playgroud) 我使用Eclipse
IDE 开发了一个使用的应用程序,Mapstruct
我现在正在IntelliJ
继续开发。
在 Eclipse 上一切正常,但由于使用了annotationProcessorPaths
.
我的配置如下:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${mapstruct.version}</version>
</path>
</annotationProcessorPaths>
<source>${java.version}</source>
<target>${java.version}</target>
<compilerArgs>
<compilerArg>
-Amapstruct.defaultComponentModel=${mapstruct.defaultComponentModel}
</compilerArg>
<compilerArg>
-Aorg.hibernate.jpamodelgen.JPAMetaModelEntityProcessor
</compilerArg>
</compilerArgs>
</configuration>
Run Code Online (Sandbox Code Playgroud)
在 IntelliJ 上,当我启动 Maven 全新安装时,我得到了生成的源代码:
@Component
public class FieldMapperImpl implements FieldMapper {
@Autowired
private FieldMapperResolver fieldMapperResolver;
...
}
Run Code Online (Sandbox Code Playgroud)
但是当我运行/调试我的 Spring Boot 应用程序时,我得到的生成源是:
public class FieldMapperImpl implements FieldMapper {
private final FieldMapperResolver fieldMapperResolver = new FieldMapperResolver();
...
}
Run Code Online (Sandbox Code Playgroud)
我怎么解决这个问题 ?
angular ×4
angular-cli ×2
javascript ×2
mapstruct ×2
ansible ×1
ansible-1.x ×1
google-maps ×1
java ×1
locale ×1
mapping ×1
maven ×1
node.js ×1
npm ×1
paramiko ×1
python ×1
python-3.x ×1
spring ×1
spring-boot ×1
typescript ×1
ubuntu ×1
webpack ×1