小编Rhy*_*vil的帖子

编辑Eclipse Javadoc $ {tags}变量

版本:Luna Service Release 2(4.4.2)

我通常使用"/**"方法在我的方法上插入Javadoc.Eclipse插入@param所有的args,@throws所有throwable和a @return.但是@return永远不会附加一个类型.它看起来像这样:

/**
 * 
 * @param criteria
 * @param filters
 * @return
 */
protected static String 
          getColumnNameFromCriteria(SelectedCriteria criteria, List<SelectionFilter> filters)
Run Code Online (Sandbox Code Playgroud)

第一个问题是:Eclipse中是否有一个开关,以便在添加Javadoc时自动插入方法返回类型?

我找不到一个,所以我查了一下:preferences-> java-> code style-> code templates-> Methods

在那个模板上,我看到一个变量${tags}.该变量是生成上面显示的Javadoc的变量.

第二个问题是:有没有一种方法可以编辑${tags}以包含${return_type}附加到@return 的变量${tags}

我希望能够键入/**<enter>并让Eclipse自动创建以下Javadoc:

/**
 * 
 * @param criteria
 * @param filters
 * @return String 
 */
protected static String 
          getColumnNameFromCriteria(SelectedCriteria criteria, List<SelectionFilter> filters)
Run Code Online (Sandbox Code Playgroud)

java eclipse javadoc

8
推荐指数
1
解决办法
2619
查看次数

Ansible 通过对象字段的值在列表中查找对象

我有这个结构。对于每个主机,这个结构可能有更多或更少的项目。在任务中,我想知道是否有使用特定名称定义的模块。

---
web_module_list:
  - module_name: LaunchPad 
    module_version: 1.4.0
  - module_name: Manager
    module_version: 1.6.0
  - module_name: NetworkInventory
    module_version: 1.1.4
  - module_name: Reporting
    module_version: 1.0.18
  - module_name: TriadJ
    module_version: 4.1.0-1.1.7
Run Code Online (Sandbox Code Playgroud)

例如,我想知道是否定义了 module_name 报告,以便我为其包含一组任务。

- set_fact:
    reporting: if the web_module_list contains an item with module_name Reporting then true else false
    woprinting: if the web_module_list contains an item with module_name WorkOrderPrinting then true else false


- name: If the reporting module is listed in inventory then execute its tasks
  include: reporting.yml
  when: reporting 

- …
Run Code Online (Sandbox Code Playgroud)

ansible

8
推荐指数
1
解决办法
7451
查看次数

在 Cypress 中,before 和 beforeEach 究竟是如何工作的?

我想我遗漏了一些关于 before 和 beforeEach 函数在赛普拉斯中工作的方式。我有一个规范文件,它从 before 方法中的夹具加载数据。其中一些数据在 before 函数中使用,然后在 beforeEach 函数中以及在实际测试中再次使用。规范文件包含 2 个测试。第一个测试按预期执行。第二个失败,因为 beforeEach 表示夹具中的一个值是未定义的。

我的期望是,如果我从 before 方法中的夹具加载数据,它应该可用于规范文件中的所有测试。

执行“检查按钮栏的状态”时,测试 beforeEach 函数中的 window.console.log(this.user_data) 会按预期输出 user_data。

执行“提交表单”测试时,beforeEach 函数中的 window.console.log(this.user_data) 输出 undefined 并且测试停止。

我在这里缺少什么?

describe('Customer Profile', () => {

    before(function () {
        window.console.log('Enter the before function')
        // Load the fixture data. Its asynchronous so if we want to use it right here and now
        // we have to put the things that use inside a callback to be executed after the data
        // …
Run Code Online (Sandbox Code Playgroud)

javascript cypress

7
推荐指数
2
解决办法
2万
查看次数

从Ansible事实角色获取MAC地址

我正在尝试获取当前主机的MAC地址,以便我可以在任务中使用该值.即使在阅读了文档之后,我似乎也无法理解如何做到这一点.我一直试图通过倾销价值来弄清楚结构.调用该角色的剧本确实收集了事实.

这就是任务的内容:

- name: Get the MAC address
  debug: msg="{{ hostvars[inventory_hostname] }}"
Run Code Online (Sandbox Code Playgroud)

这会产生以下(截断):

ok: [steve.dev.v4-1-0] => {
    "msg": {
        "ansible_all_ipv4_addresses": [
            "10.1.3.144"
        ], 
        "ansible_all_ipv6_addresses": [
            "fe80::250:56ff:fe8b:1051"
        ], 
        "ansible_architecture": "x86_64", 
        "ansible_bios_date": "09/21/2015", 
        "ansible_bios_version": "6.00", 
        "ansible_check_mode": false, 
        "ansible_cmdline": {
            "KEYBOARDTYPE": "pc", 
            "KEYTABLE": "us", 
            "LANG": "en_US.UTF-8", 
            "SYSFONT": "latarcyrheb-sun16", 
            "crashkernel": "129M@0M", 
            "quiet": true, 
            "rd_NO_DM": true, 
            "rd_NO_LUKS": true, 
            "rd_NO_LVM": true, 
            "rd_NO_MD": true, 
            "rhgb": true, 
            "ro": true, 
            "root": "UUID=408345fe-146b-4dec-b62c-31fe6d60b376"
        }, 
        "ansible_date_time": {
            "date": "2016-10-24", 
            "day": "24", 
            "epoch": "1477329455", 
            "hour": "10", 
            "iso8601": "2016-10-24T17:17:35Z", 
            "iso8601_basic": "20161024T101735509516", 
            "iso8601_basic_short": "20161024T101735", …
Run Code Online (Sandbox Code Playgroud)

ansible ansible-playbook ansible-facts

4
推荐指数
2
解决办法
6192
查看次数

为什么我的Ansible处理程序没有解雇?

我有一个安装tomcat的playbook然后部署一些web应用程序.Web应用程序部署任务通知处理程序重新启动tomcat.但处理程序永远不会触发.我正在使用一个处理程序来管理tomcat服务,因为我从文档中了解到,即使多次调用,处理程序也应该只触发一次.我错过了一些明显的东西吗

这是剧本:

---
- hosts: all
  become: true
  become_user: root
  roles:
  - role: common
  - role: nginx
  - role: tomcat
  - role: launchpad
  - role: manager
  - role: reporting
  handlers:
  - include: /tomcat/handlers/etitomcat_service_ctrl.yml
Run Code Online (Sandbox Code Playgroud)

这是部署Web应用程序的角色之一:

---
- name: Remove the current installation of LaunchPad
  file: path={{etitomcat_path}}/webapps/{{launchpad_module}} state=absent

- name: Remove the current war file for {{launchpad_module}}
  file: path={{etitomcat_path}}/webapps/{{launchpad_module}}.war state=absent     

- name: Download the latest snapshot of LaunchPad and deploy it to {{etitomcat_path}}
  get_url: url={{launchpad_source_url}} dest={{etitomcat_path}}/webapps/{{launchpad_module}}.war mode=0744 owner={{etitomcat_user}} group={{etitomcat_group}} force=yes
  notify: "restart_eti_tomcat" …
Run Code Online (Sandbox Code Playgroud)

ansible ansible-playbook

3
推荐指数
2
解决办法
3522
查看次数

使用 FFMPEG 从音频生成波形视频

我正在尝试从音频创建波形视频。我的目标是制作一个看起来像这样的视频

在此处输入图片说明

对于我的测试,我有一个播放短片声音的 mp3。有 4 个 1/4 音符小节和 4 个 1/8 音符小节以 120bpm 播放。我在想出正确的预处理和过滤组合以生成看起来像图像的视频时遇到了一些麻烦。颜色不必精确,我更关心节拍的形状。我使用 showwaves 和 showspectrum 尝试了几种不同的方法。我无法完全理解为什么在使用 showwaves 时节拍过得如此之快,但使用 showspectrum 会生成一个视频,我可以在其中看到每个节拍。

秀波

ffmpeg -i beat_test.mp3 -filter_complex "[0:a]showwaves=s=1280x100:mode=cline:rate=25:scale=sqrt,format=yuv420p[v]" -map "[v]" -map 0:a output_wav.mp4
Run Code Online (Sandbox Code Playgroud)

链接将下载该命令的输出。

显示频谱

ffmpeg -i beat_test.mp3 -filter_complex "[0:a]showspectrum=s=1280x100:mode=combined:color=intensity:saturation=5:slide=1:scale=cbrt,format=yuv420p[v]" -map "[v]" -an -map 0:a output_spec.mp4
Run Code Online (Sandbox Code Playgroud)

链接将下载该命令的输出。

我发布了简单的示例,因为我不想通过添加我尝试过的所有变体来混淆问题。

在实践中,我想我可以摆脱 showspectrum 的输出,但我想了解我在哪里/如何错误地思考这个问题。感谢您的任何建议。

这是源音频文件的链接

ffmpeg

3
推荐指数
1
解决办法
2988
查看次数