小编Rod*_*eas的帖子

如何在AngularJs中旋转图像

这是我的代码:如何在元素框中单击时仅旋转带有角度的svg-arrow?

<md-card class="header" style="margin: 0 0 4px 0;" ng-mousedown="toggleCollapse('source')">
  <md-card-content layout="row" layout-align="start center">
    <img src="../assets/icons/cd-icon-arrow.svg" class="buildrag-toggle">
    <h2 class="md-title no-top-margin no-bottom-margin" flex style="padding-left: 10px;">Data</h2>
    <md-button class="md-icon-button header-button" ng-mousedown="addDataSource($event)">
      <md-icon>add_circle_outline</md-icon>
    </md-button>
  </md-card-content>
</md-card>
Run Code Online (Sandbox Code Playgroud)

这是我的按钮

angularjs angularjs-material

4
推荐指数
1
解决办法
4918
查看次数

从GWT元素中删除内联样式属性

我继承了许多传统的GWT代码,可以简洁地描述为"Web开发人员最糟糕的噩梦".开发人员使用了许多具有内联样式的元素 - 例如,GWT DeckPanel.

我想删除这些内联样式,以便我可以应用外部样式表,但我似乎无法找到任何方法来执行此操作.我知道可以通过这个设置内联样式:DOM.setStyleAttribute(container1, "height", "100%");或类似,但似乎没有任何类型的对应removeStyleAttribute.有一个,DOM.removeElementAttribute但这不适用于样式.

有没有办法从属性中明确删除所有内联样式?我尝试使用谷歌搜索,但我最终找到了与UIBinder相关的内容以及来自GWT的许多防守帖子"你为什么要这样做?" 我不能做太多的代码修改,因为这个应用程序是庞大的,我在截止日期.我们没有使用UIBinder.

gwt styling

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

声明CSS规则仅适用于特定类

我有以下CSS我只需要申请一个特定的div(因为冲突):

有问题的div有类名datepicker-days.我是否将以下内容声明table.datepicker-days.table?但是,我如何在.table下面宣布这个类呢?

CSS

    table {
      max-width: 100%;
      border-collapse: collapse;
      border-spacing: 0;
    }
    .table {
      width: 100%;
      margin-bottom: 18px;
    }
    .table th, .table td {
      padding: 8px;
      line-height: 18px;
      text-align: left;
      border-top: 1px solid #ddd;
    }
Run Code Online (Sandbox Code Playgroud)

HTML

<div class="datepicker-days" style="display: block; ">
      <table class=" table-condensed">
         <thead>
             <tr>
                <th class="prev">
                ....
Run Code Online (Sandbox Code Playgroud)

很抱歉,如果不清楚,CSS规则来自Bootstrap.我只是使用了一些规则,因为我使用的datepicker插件取决于那些特定的规则.所以我<tables>在我的代码中有其他实例,我不希望这些规则适用.

html css

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

GWT:可以从外部JavaScript而不是JSNI调用Java方法吗?

我正在尝试将大部分原生JavaScript代码从JSNI方法转移到脚本中,并且只是利用本机JSNI方法来调用这些外部方法.

现在我的一个点击处理程序遇到了困难.当用户单击某个特定元素时,JSNI方法会执行一些基于JQuery的动画,然后在回调中调用Java方法.一个简单的例子是这样的:

public native void attachClickHandler(SomeCustomPanel customPanel) /*-{
    $wnd.jQuery("#theElement").click(function() {
        // some JQuery animation logic here...
        $wnd.jQuery("#theElement").animate({ top: "500px" }, 500, function() {
            customPanel.@com.something.whatever.client.SomeCustomPanel::doSomething()();
        });
        // some other code here...
    });
}-*/;
Run Code Online (Sandbox Code Playgroud)

这段代码有效.它编译并按预期工作.我想将其转换为外部JavaScript.我尝试了以下内容.我把它放在外部JavaScript中:

function attachClickAction(customPanel) {
    $("#theElement").click(function() {
        // other stuff...
        $("#theElement").animate({ top: "500px" }, 500, function() {
            customPanel.@com.something.whatever.client.SomeCustomPanel::doSomething()();
        });
        // other stuff...
    });
}
Run Code Online (Sandbox Code Playgroud)

并修改了这样的原生函数:

public native void attachClickHandler(SomeCustomPanel customPanel) /*-{
    $wnd.attachClickAction(customPanel);
}-*/;
Run Code Online (Sandbox Code Playgroud)

但是不正确.JavaScript文件甚至不会加载,因为这不是正确的JavaScript.(Chome的开发工具给我错误消息"Uncaught SyntaxError:Unexpected identifier".)

有没有办法从外部JavaScript文件调用Java方法,而不是从JSNI方法调用?

如果重要的话,我在GWT 2.4中.

javascript gwt jsni

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

计划中的(引用引用)

我正在努力学习计划.谁能告诉我为什么'(quote quote)输出'quote,'(quote 'quote)并将输出''quote

非常感谢你!

scheme racket quote

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

为什么包装类没有类似于 Stringpool 的池?

Integer、Character、Double 等——所有这些都是像 String 这样的不可变类。String 有 Stringpool 来节省内存,但为什么这些包装器没有类似的池?

我检查过:Integer 有一个类似的池,最多只有 127 个,但不会更多。

java string wrapper string-pool

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

Cassandra并不是从Java 10开始的

我有一个全新的Windows 10 Home安装,全新安装JDK 10.0.1(这是我在访问JDK下载站点时推荐的.)我刚刚下载了Cassandra 3.11.2,un-tar'它,并将bin目录放在我的类路径上.

当我尝试使用该cassandra -f命令启动Cassandra时,我收到此错误:

PS C:\javatools> cassandra -f
*---------------------------------------------------------------------*
*---------------------------------------------------------------------*
WARNING! Automatic page file configuration detected.
 It is recommended that you disable swap when running Cassandra
 for performance and stability reasons.
*---------------------------------------------------------------------*
*---------------------------------------------------------------------*
Failed 64-bit check. Re-running to get version from 32-bit
*---------------------------------------------------------------------*
*---------------------------------------------------------------------*
Cassandra 3.0 and later require Java 8u40 or later.
Run Code Online (Sandbox Code Playgroud)

Java 10显然是"Java 8 rel 40或更高版本".事实上,我确认我正在运行我认为的Java版本:

PS C:\javatools> java -version
java version "10.0.1" 2018-04-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) …
Run Code Online (Sandbox Code Playgroud)

cassandra cassandra-3.0

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

无法从 openapi-generator mustache 模板引用供应商扩展

我有一个 Open API 3 规范的 yaml 文件,它有一些 x- 前缀的属性。我正在尝试使用 openapi-generator-cli 生成一个 Angular Typescript SDK。但是,当我在模板胡子中引用该属性时,以 x 为前缀的属性始终为空。

来自 yaml 的示例端点(省略了不相关的内容):

/about:
  get:
    summary: Information about this API
    x-foo: getAbout
Run Code Online (Sandbox Code Playgroud)

我如何在 Mustache 模板中使用它(省略了不相关的内容):

{{#operation}}
  public {{x-foo}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
Run Code Online (Sandbox Code Playgroud)

(基本上,我正在尝试使用 x-foo 参数作为正在生成的 SDK 中的方法名称。)

但是,生成的 SDK 替换{{x-foo}}为空白:

public ()
Run Code Online (Sandbox Code Playgroud)

这就是我调用生成器的方式(没有换行符):

openapi-generator generate 
    --generator-name typescript-angular 
    --template-dir ./path/to/templates 
    --input-spec ./path/to/api.yml 
    --output ./output 
    --config ./path/to/config.json
Run Code Online (Sandbox Code Playgroud)

如何从 openapi-generator 模板中引用供应商扩展/以 x 为前缀的 Open API 3 属性?

openapi-generator

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

以管理员身份运行时,minikube 中的“Hyper-v 命令必须以管理员身份运行”

Windows 10 企业版。我正在尝试设置 minikube 并遵循官方文档。当我尝试确认安装时,使用以下命令:

minikube start --driver=hyperv
Run Code Online (Sandbox Code Playgroud)

然后我得到这个错误:

X Exiting due to PR_HYPERV_AS_ADMIN: Failed to start host: creating host: create: precreate: Hyper-v commands have to be run as an Administrator
* Suggestion: Right-click the PowerShell icon and select Run as Administrator to open PowerShell in elevated mode.
* Documentation: https://rominirani.com/docker-machine-windows-10-hyper-v-troubleshooting-tips-367c1ea73c24
* Related issue: https://github.com/kubernetes/minikube/issues/4511
Run Code Online (Sandbox Code Playgroud)

但是,我以管理员身份运行 Powershell (开始菜单 > 右键单击​​ Powershell 图标 > 选择“以管理员身份运行”。)我还尝试以管理员身份运行常规 cmd 实例——同样的问题。不幸的是,消息中的“文档”页面是 404,并且“相关问题”已关闭,没有任何有用的信息。

如何向我的 Powershell 或 cmd 实例应用适当的管理员权限,以便能够将 minikube 与 Hyper-V 结合使用?这个另一个问题 …

powershell windows-10 minikube

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

从一个表读取行并将其复制到Java中的另一个数据库表

我的Java数据库中有2个表.我想从table1加载行并将它们放在table2中.怎么可以呢?我正在使用ResultSet res = stmt.executeQuery(SQL)从表I中读取的内容.我可以使用什么来将这些数据放到表II中.?

java sql database

2
推荐指数
1
解决办法
6864
查看次数