小编Mah*_*hdi的帖子

如何在具有严格doctype的HTML页面中查看阿拉伯语/波斯语数字?

我有一个从右到左的HTML页面.当我不使用任何doctype时,我的数字是阿拉伯语/波斯语,但是当我使用严格模式时,他们会转向英语.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Final//EN">
Run Code Online (Sandbox Code Playgroud)

在添加doctype之前:

在添加doctype之前

添加doctype后:

添加doctype后

我也将这些元标记添加到我的页面:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="fa" />
Run Code Online (Sandbox Code Playgroud)

那么如何在具有严格doctype的页面中查看阿拉伯数字(在IE中,因为Firefox无论如何都不显示阿拉伯数字)?

html doctype numbers xhtml-1.0-strict arabic

12
推荐指数
4
解决办法
3万
查看次数

如何从JavaScript更新UpdatePanel

给定一个包含UpdatePanels的Asp.Net页面.如何从客户端更新特定的UpdatePanel.

是否可以从此页面打开的对话框中更新它?(通过window.open)

提前致谢.

javascript asp.net ajax updatepanel

5
推荐指数
1
解决办法
1万
查看次数

我们可以使用大众运输将 RabbitMQ 和 Mediatr 一起使用吗?

我创建了一个微服务应用程序,该应用程序使用MassTransitRabbitMQ进行微服务进行通信。
每个微服务都使用干净的架构开发,因此我们在每个微服务中都有MediatR
是否也可以使用 MassTransit 进行内部通信?因此我可以对所有服务使用相同的签名,并且当我想公开要在微服务间使用的服务时,这将很容易实现。所以MediatR用于内部通信,RabbitMQ用于内部通信,整个宇宙都在MassTransit系统上。
[更新]我的问题是我们如何配置消费者,以便一些可用于内部通信(通过 MediatR),一些可用于外部通信(通过 RabbitMQ),并轻松地将它们从内部更改为外部。
[Update2]例如这里是我的大众运输注册:

services.AddMassTransit(x =>
        {
            x.AddConsumers(Assembly.GetExecutingAssembly());

            x.AddBus(provider =>
                Bus.Factory.CreateUsingRabbitMq(cfg =>
                {
                    cfg.Host(new Uri(config.RabbitMQ.Address), h =>
                    {
                        h.Username(config.RabbitMQ.Username);
                        h.Password(config.RabbitMQ.Password);
                    });

                    cfg.ReceiveEndpoint("my-queue", ep => { ep.ConfigureConsumers(provider); });
                }));


            x.AddMediator((provider, cfg) => { cfg.ConfigureConsumers(provider); });
        });
Run Code Online (Sandbox Code Playgroud)

我如何区分内部沟通和外部沟通?换句话说,我如何将一些消费者注册到 MediatR 而一些消费者注册到 RabbitMQ?

masstransit rabbitmq microservices mediatr

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

使用AngularJS $ http和Jasmine进行集成测试

我有一个AngularJS服务,通过$ http这样调用服务器

function DefineCourseService($http) {
  var service = {
    getCourses: getCourses
  };

  function getCourses(id) {
    return $http({
      url: '/api/Course',
      method: 'GET'
    });
  }
}
Run Code Online (Sandbox Code Playgroud)

并且服务器返回:

[{Code:'123',Title:'Test'}]
Run Code Online (Sandbox Code Playgroud)

我想使用Jasmine编写一个集成测试,它从服务器获取响应并检查其值.测试文件如下:

(function() {
  'use strict';
  define(['angular-mocks', 'defineCourse.service'], function() {
    describe("Course service", function() {
      var courseService, data, deferredResolution, parentScope;

      beforeEach(function() {
        module('modabber.services');

      });

      beforeEach(inject(function($q, $rootScope, DefineCourseService) {
        courseService = DefineCourseService;
        deferredResolution = $q.defer();
        parentScope = $rootScope;
      }));

      it("get courses", function() {
        spyOn(courseService, 'getCourses').and.callThrough();
        deferredResolution.resolve();
        courseService.getCourses().then(function(result) {
          data = result;
        });
        expect(courseService.getCourses).toHaveBeenCalled();
        expect(data).toBeUndefined();

        parentScope.$digest();
        expect(data).toBeDefined();
        done(); …
Run Code Online (Sandbox Code Playgroud)

integration-testing jasmine angularjs

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