小编Sur*_*Rao的帖子

Numpy教程 - 布尔索引

读Numpy快速教程,我无法理解这句话.

a = np.arange(12).reshape(3,4)
b1 = np.array([False,True,True]) 
b2 = np.array([True,False,True,False])
>>> a[b1,b2]  
array([ 4, 10])
Run Code Online (Sandbox Code Playgroud)

为什么a[b1,b2]是array([4,10])不是array([[4,6],[8,10]])?

python numpy

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

C#Sort vs JavaScript Sort

我有以下数组作为输入以降序排序值:

var cars = ["8587009748118224023Po","8587009748118224023PP","8587009748118224023P,","8587009748118224023P$","8587009748118224023P<","8587009748118224023P?"]
Run Code Online (Sandbox Code Playgroud)

在C#中,我正在使用OrderByDescending并获得以下输出

C#代码:

var rslt= cars.OrderByDescending(a => a);
Run Code Online (Sandbox Code Playgroud)

结果:

8587009748118224023PP,8587009748118224023Po,8587009748118224023P<,8587009748118224023P?,8587009748118224023P,,8587009748118224023P$
Run Code Online (Sandbox Code Playgroud)

在Javascript中,我使用排序和反向并获得以下不同的结果

javascript代码:

cars.sort();
cars.reverse();
Run Code Online (Sandbox Code Playgroud)

结果:

8587009748118224023Po,8587009748118224023PP,8587009748118224023P?,8587009748118224023P<,8587009748118224023P,,8587009748118224023P$
Run Code Online (Sandbox Code Playgroud)

任何人都可以帮我如何在C#中对值进行排序,就像javascript一样?

.net javascript c# asp.net sorting

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

JavaScript 堆内存不足

npm start我在使用角度页面时收到以下错误。

C:\TPO\Client\Angular>ng serve
Your global Angular CLI version (1.3.2) is greater than your local
version (1.0.4). The local Angular CLI version is used.

To disable this warning use "ng set --global warnings.versionMismatch=false".
** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200 **
10% building modules 4/4 modules 0 active
<--- Last few GCs --->

  118169 ms: Mark-sweep 1348.4 (1404.3) -> 1348.1 (1404.3) MB, 1338.9 / 0.0 ms [allocation failure] [GC in old space …
Run Code Online (Sandbox Code Playgroud)

javascript angular

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

通过API获取Jenkins Metrics数据

API 调用需要什么

API 调用需要什么

我需要通过 Jenkins 指标插件的 API 调用获得每个构建的时间线信息。我正在使用 Web API 来获取我的 jenkins 中的工作数据。然而,打电话$JenkinsUrl/metrics/APIkey却无济于事。知道如何获取这些信息吗?

api jenkins jenkins-plugins

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

Ionic 3“ionic cordova build android --prod”错误元数据版本不匹配

运行命令“ionic cordova build android --prod”后出现以下错误。

Error: Metadata version mismatch for module C:/Users/newuser/Documents/project/project/node_modules/@ionic/storage/dist/src/storage.d.ts, found version 4, expected 3
    at StaticSymbolResolver.getModuleMetadata (C:\Users\newuser\Documents\project\project\node_modules\@angular\compiler\bundles\compiler.umd.js:24474:34)
    at StaticSymbolResolver._createSymbolsOf (C:\Users\newuser\Documents\project\project\node_modules\@angular\compiler\bundles\compiler.umd.js:24260:46)
    at StaticSymbolResolver.getSymbolsOf (C:\Users\newuser\Documents\project\project\node_modules\@angular\compiler\bundles\compiler.umd.js:24241:14)
    at C:\Users\newuser\Documents\project\project\node_modules\@angular\compiler\bundles\compiler.umd.js:23023:30
    at Array.forEach (<anonymous>)
    at extractProgramSymbols (C:\Users\newuser\Documents\project\project\node_modules\@angular\compiler\bundles\compiler.umd.js:23022:79)
    at AotCompiler.compileAll (C:\Users\newuser\Documents\project\project\node_modules\@angular\compiler\bundles\compiler.umd.js:22720:47)
    at CodeGenerator.codegen (C:\Users\newuser\Documents\project\project\node_modules\@angular\compiler-cli\src\codegen.js:30:14)
    at Function.NgTools_InternalApi_NG_2.codeGen (C:\Users\newuser\Documents\project\project\node_modules\@angular\compiler-cli\src\ngtools_api.js:61:30)
    at Object.doCodegen (C:\Users\newuser\Documents\project\project\node_modules\@ionic\app-scripts\dist\aot\codegen.js:6:51)
Run Code Online (Sandbox Code Playgroud)

离子信息:

@ionic/cli-utils  : 1.14.0
ionic (Ionic CLI) : 3.14.0
Run Code Online (Sandbox Code Playgroud)

全局包:

cordova (Cordova CLI) : 7.1.0
Run Code Online (Sandbox Code Playgroud)

本地包:

@ionic/app-scripts : 2.1.3
Cordova Platforms  : android 6.3.0
Ionic Framework    : ionic-angular 3.6.0
Run Code Online (Sandbox Code Playgroud)

系统:

Node : v8.9.0
npm …
Run Code Online (Sandbox Code Playgroud)

ionic3 angular

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

wso2 ei服务器,禁止错误403,不访问核心,错误:请求中缺少必需的令牌

我正在安装WSO2 EI 6.1.1

integrator --run : 
https://localhost:9445/carbon/admin/login.jsp -> OK

wso2serber.bat : EI-Business-Process Server 
https://localhost:9445/carbon/admin/login_action.jsp
Error 403 - Forbidden

[EI-Business-Process]  WARN {org.owasp.csrfguard.log.JavaLogger} -  potential cross-site request forgery (CSRF) attack thwarted (user:<anonymous>, ip:192.168.1.11, method:POST, uri:/carbon/admin/login_action.jsp, error:required token is missing from the request)

and wso2serber.bat : EI-Analytics
https://localhost:9444/carbon/admin/login_action.jsp
Error 403 - Forbidden

 [EI-Analytics]  WARN {org.owasp.csrfguard.log.JavaLogger} -  potential cross-site request forgery (CSRF) attack thwarted (user:<anonymous>, ip:192.168.1.11, method:POST, uri:/carbon/admin/login_action.jsp, error:required token is missing from the request)
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个问题?如何使WSO2 WSO2 EI下的wso2 Bu​​siness Process Server管理控制台可用?

wso2 bpmn wso2esb wso2-business-process wso2-enterprise-integrator

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

如何转换Array {Array {Int64,2},1}到Array {Int64,2}

在Julia中,我想将定义为2D数组的Vector的数据转换为Matrix的2D数组.如下例所示,我想将数据转换为数据t,但到目前为止我还没有成功.我该如何处理此案?

julia> s = [[1 2 3], [4 5 6], [7 8 9]]
3-element Array{Array{Int64,2},1}:
 [1 2 3]
 [4 5 6]
 [7 8 9]

julia> t = [[1 2 3]; [4 5 6]; [7 8 9]]
3××3 Array{Int64,2}:
 1  2  3
 4  5  6
 7  8  9

julia> s |> typeof
Array{Array{Int64,2},1}

julia> t |> typeof
Array{Int64,2}

julia> convert(Array{Int64, 2}, s)
ERROR: MethodError: Cannot `convert` an object of type Array{Array{Int64,2},1} to an object of type Array{Int64,2}
This may have arisen …
Run Code Online (Sandbox Code Playgroud)

arrays matrix julia

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

在ionic3中延迟加载,但是错误:找不到组件工厂

我在ionic3中使用延迟加载,但是当它服务时,浏览器会显示错误:

无法导航:找不到TabsPage的组件工厂.你有没有把它添加到@ NgModule.entryComponents?

这是我的代码:

app.module.ts

@NgModule({
  declarations: [ 
    MyApp, 
    FormModal,
    PreviewModal, 
  ],
  imports: [
    BrowserModule,
    HttpModule,
    JsonpModule,
    CommonModule, 
    IonicModule.forRoot(MyApp)
  ],
  bootstrap: [IonicApp], 
  entryComponents: [ 
    MyApp, 
  ],
  providers: [ 
    Router,
    StatusBar,
    SplashScreen,
    ApiService,
    Toast,
    Loading,
    Alert,
    UserService,
    ChangeTitle,
    ParseLogin,
    {provide: ErrorHandler, useClass: IonicErrorHandler}
  ]
})
export class AppModule {}
Run Code Online (Sandbox Code Playgroud)

app.component.ts

@Component({
  templateUrl: 'app.html'
})
export class MyApp {

  rootPage:any = "TabsPage";

  constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen,router:Router) {
    router.setVersion('1.0',10000);
    router.load(Routes);
    Event.subscribe('push',(ev,data)=>{
      document.title =Routes[data.toPage.name].title;
      var i = document.createElement('iframe');
      i.src = 'blank.html';
      i.style.display …
Run Code Online (Sandbox Code Playgroud)

lazy-loading typescript ionic3 angular

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

为什么如果比较在java中不起作用

我在java中创建一个哈希表.在搜索功能中,我在IF语句中进行了一些比较.但它没有做任何比较.

这是我的代码的一部分.


while (table[pos]!=null) {
        if (table[pos]==key) {
            System.out.println("SEARCH "+key+" at INDEX "+home);
            return;
        }
        else {pos=h(home+p(i));
        i++;
        }
    }
    System.out.println("Failed to find "+key+".");
    return;
}
Run Code Online (Sandbox Code Playgroud)

即使表[pos]和键是相同的,它也不起作用!但我将非常简单的赋值变量添加到另一个变量.这行得通!我不知道为什么会这样.我想知道它xD

   while (table[pos]!=null) {
        int x = table[pos];
        if (x==key) {
            System.out.println("SEARCH "+key+" at INDEX "+home);
            return;
        }
        else {pos=h(home+p(i));
        i++;
        }
    }
    System.out.println("Failed to find "+key+".");
    return;
}
Run Code Online (Sandbox Code Playgroud)

java comparison if-statement assign

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

警报消息上的新行

无论如何,在Ionic 3中使用警报显示新行吗?

我应该用'\ n'代替什么?

doFinalise() {
let confirm = this.alertCtrl.create({
  title: 'Are you sure?',
  message: 'Are these details correct?\n Price ($/L): \n KMs Done: \n Total Spent: \n Fuel Type: \n Date: ',
  buttons: [ etc...
Run Code Online (Sandbox Code Playgroud)

最终,该消息将在新行之前显示变量,但是在此阶段不需要。

ionic2 ionic3

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