我真的很困惑如何设置日志记录并使用Azure查看日志.
我有一个已部署到云端的ASP.NET Web应用程序,但我没有太多运气配置或设置Azure的日志记录.
有很多关于Azure诊断,工作者角色等的信息,但我不清楚他们甚至是如何与ASP.NET Web应用程序相关的.
有没有人知道一个简单的(最新)教程,只是为了能够在Azure中编写和查看ASP.NET应用程序的日志.
自从我使用ASP.NET并与Azure合作以来,这已经有一段时间了.

我正在使用Angular构建通用代码生成器
我有动态数据结构和模板,旨在构建不同类型的代码。HTML,C#,SQL,Javascript,CSS,Ruby。
我已经获得$ compile函数作为指令的一部分工作,并且可以在Angular页面中注入元素。
我真正需要的是生成一个简单的字符串的生成。
我读过的每一篇文章都谈到获取编译后的输出并将其注入角度管道,这不是我的要求。
有谁知道我可以从已经与合并范围数据合并的已编译模板中提取一个简单的字符串吗?
angular.module('workibleServerApp')
.directive('generateDynamicTemplate', ['$compile', function ($compile) {
return {
scope: true,
data: '=',
rawTemplate: '=',
restrict: 'E',
link: function (scope, element, attrs) {
scope.$watchGroup([attrs.data, attrs.rawTemplate], function (newValues) {
scope.data = newValues[0];
var rawTemplate = newValues[1];
element.html('');
//element.html('<textarea id="outputRaw" name="outputRaw" class="form-control" rows="12">');
if (!_.isEmpty(scope.data) && !_.isEmpty(rawTemplate)) {
var tl = angular.element(rawTemplate);
var compiled = $compile(tl)(scope);
element.append(compiled);
scope.convertToString = compiled;
}
//element.append('</textarea>');
});
}
};
}]);
Run Code Online (Sandbox Code Playgroud)
没有填充convertToString
<div class="col-md-6">
<h6><strong>Output</strong></h6>
<!-- This renders output from the …Run Code Online (Sandbox Code Playgroud) 我已经开始使用MEAN堆栈,目前正在使用Super Test编写REST单元测试
我希望日志文件更加清晰,以便可以轻松查看成功和失败的测试。
我希望抑制实际的其余API调用的控制台输出,我认为这些调用来自SuperTest。
此图像显示了我要隐藏的日志。
我想自定义我的Mongoose模型生成的验证消息.
我倾向于不直接在架构对象上放置我的验证(例如必需),因为没有自由拥有自定义错误消息.例如
sourceAccountId: {
type: Schema.ObjectId,
require: true,
ref: 'Account'
}
Run Code Online (Sandbox Code Playgroud)
相反,我做了以下.
sourceAccountId: {
type: Schema.ObjectId,
ref: 'Account'
}
ConnectionRequestSchema.path('sourceAccountId').required(true, 'Source Account is required.');
Run Code Online (Sandbox Code Playgroud)
当字段具有枚举约束时,我无法找到覆盖默认枚举消息的方法.
我的模型列在下面,状态验证消息适用于所需,但不适用于枚举.
'use strict';
var _ = require('lodash');
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var ConnectionRequestSchema = new Schema({
created_at: { type: Date },
updated_at: { type: Date },
sourceAccountId: {
type: Schema.ObjectId,
ref: 'Account'
},
status: {
type: String,
enum: ['pending', 'accept', 'decline'],
trim: true
}
});
// ------------------------------------------------------------
// Validations
// ------------------------------------------------------------ …Run Code Online (Sandbox Code Playgroud) 我正在使用两个ng-bootstrap组件ngbDropdown,ngb-pagination我希望它们彼此垂直对齐.
该ngb-pagination组件使用.pagination类创建此HTML,边距为1rem
<nav>
<ul ng-reflect-class-name="pagination pagination-sm" class="pagination pagination-sm">
</ul>
</nav>
Run Code Online (Sandbox Code Playgroud)
我试图使用以下内容改变我的Angular 2组件.
@Component({
selector: 'wk-company-list',
template: require('./list.html'),
styles: [`
.pagination {
margin-top: 0;
background-color: greenyellow;
}
`]
})
Run Code Online (Sandbox Code Playgroud)
这是带有这两个控件的完整HTML页面
<ag-grid-ng2 #agGrid style="width: 100%; height: 350px;" class="ag-fresh"
[gridOptions]="gridOptions"
rowSelection="multiple"
(cellClicked)="onCellClicked($event)"
(selectionChanged)="onSelectionChanged($event)">
</ag-grid-ng2>
<div class="align-middle">
<span ngbDropdown class="d-inline-block">
<button class="btn btn-outline-primary btn-sm" id="dropdownMenu2" ngbDropdownToggle>25</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenu2">
<button class="dropdown-item">25</button>
<button class="dropdown-item">50</button>
<button class="dropdown-item">100</button>
<button class="dropdown-item">200</button>
<button class="dropdown-item">1000</button>
<span class="text-muted">Total: {{vm.pagination.total}}</span>
</div>
</span>
<span class="float-xs-right">
<ngb-pagination
style="margin-top: …Run Code Online (Sandbox Code Playgroud) 我有一个chrome扩展,在开发中使用HTTP进行通信,在生产中使用HTTPS进行通信.
我从使用HTTPS的网页运行它.
当我在开发模式中使用此扩展时,我收到以下错误.
混合内容:" https://somesite.com " 页面是通过HTTPS加载的,但是请求了一个不安全的XMLHttpRequest端点' http://david-sniper.local:3001/api/end-point '.此内容也应通过HTTPS提供.
在过去,我已经能够通过阅读这篇文章来解决这个错误如何获取chrome-to-allow-mixed-content
这篇文章有两个解决方案.
我从来没有成功使用第一个解决方案,但是你点击'shield'图标的第二个解决方案直到几个星期前一直在运行.
我现在使用的是Chrome 55,并且没有用于点击的Shield选项,所以我想知道如何在开发者模式下使用混合内容?
javascript ajax google-chrome google-chrome-extension mixed-content
我正在使用EPPLus打开Excel Spreadsheets并尝试从命名范围读取.命名范围为空.
我使用这个错误,还是EPPlus的问题
码
var package = new ExcelPackage();
using (var stream = File.OpenRead(tmpExcel))
{
package.Load(stream);
}
var worksheet = package.Workbook.Worksheets["Common-Lookup"];
using (ExcelNamedRange namedRange = worksheet.Names["LupVerticalSettings"])
{
for (var row = namedRange.Start.Row; row <= namedRange.End.Row; row++)
{
for (var col = namedRange.Start.Column; col <= namedRange.End.Column; col++)
{
_.Nv(worksheet.Cells[row, col].Address, worksheet.Cells[row, col].Text);
//worksheet.Cells[rowIndex, columnIndex].Value = "no more hair pulling";
}
}
}
Run Code Online (Sandbox Code Playgroud)
Excel看起来像这样

空命名范围

我刚刚升级到最新的WebPack,我的现有配置引发了一个错误,我已经找到了导致问题的代码,但不知道如何解决它.
我已将此错误跟踪到此处
{
test: /\.(css|scss)$/,
loaders: ExtractTextPlugin.extract({
fallbackLoader: 'style',
loader: 'css?minimize!sass!postcss'
})
},
Run Code Online (Sandbox Code Playgroud)
来自Package.json的条目
"webpack": "2.2.1",
"extract-text-webpack-plugin": "^2.0.0-beta.3",
"html-webpack-plugin": "^2.24.1",
Run Code Online (Sandbox Code Playgroud)
错误
ERROR in ./~/css-loader?minimize!./~/sass-loader/lib/loader.js!./~/postcss-loader!./src/index.scss
Module build failed: No input specified: provide a file name or a source string to process
@ ./src/index.scss 4:14-172
@ ./src/main.ts
ERROR in ./src/index.scss
Module build failed: ModuleBuildError: Module build failed: No input specified: provide a file name or a source string to process
at d:\workible\data-extractor\app-client\node_modules\webpack\lib\NormalModule.js:137:35
at d:\workible\data-extractor\app-client\node_modules\loader-runner\lib\LoaderRunner.js:364:11
at d:\workible\data-extractor\app-client\node_modules\loader-runner\lib\LoaderRunner.js:230:18
at context.callback (d:\workible\data-extractor\app-client\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
at Object.asyncSassJobQueue.push [as …Run Code Online (Sandbox Code Playgroud) 我正在关注 Angular 2 教程,其中input通过单击事件将元素传递给函数。
本教程有一个带有此签名的 addTodo 函数addTodo(event, todoText){ }。这段代码抛出了参数“todoText”具有隐式“any”类型的警告。
我想知道是否有一个 TypeScript 对象可以用来代替any它代表一个form input control
Angular 2 HTML 示例
<div class="add-todo-form text-center">
<h1>Add ToDo</h1>
<div class="form-group">
<input class="form-control input-lg" placeholder="Add Todo.." autofocus #todoText>
<br>
<button (click)="addTodo($event, todoText)" class="btn btn-primary btn-block">Create</button>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
示例打字稿
addTodo(event: any, todoText: any){
console.log('xxxxxxxxxxx');
var result: any;
var newTodo = {
text: todoText,
isCompleted: false
};
result = this._todoService.saveTodo(newTodo);
result.subscribe( (x: any)=> {
this.todos.push(newTodo);
todoText.value = '';
})
}
Run Code Online (Sandbox Code Playgroud) 我遵循Angular Tutorials,我在他们的例子中看到,使用指令将ng-scope添加到每个元素.
https://docs.angularjs.org/guide/scope
但我自己的代码确实不添加纳克范围的每一个指令,每一件事情似乎从绘制数据的工作,但由于某种原因没有加入这个CSS类.
我的应用程序已从Yeoman.io启动项目开始,所以我不确定该项目中的某些内容是否导致了该问题.
https://github.com/diegonetto/generator-ionic
我在我的保管箱中添加了www代码作为.zip:
https://www.dropbox.com/s/hn36080isu83vw5/www.zip
教程示例

我的例子

HTML
<h1 style="margin-top: 50px;">Scope Heirachy</h1>
<div class="show-scope-demo">
<div ng-controller="ParentGreetController">
Hello {{name}}!
</div>
<div ng-controller="ChildListController">
<ol>
<li ng-repeat="name in names">{{name}} from {{department}}</li>
</ol>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
Controller.JS
var moduleTest = angular.module('test', []);
moduleTest
.controller('ParentGreetController', ['$scope', '$rootScope', function ($scope, $rootScope)
{
$scope.name = 'World';
$rootScope.department = 'Angular';
}])
// We will access name which is in both scopes
.controller('ChildListController', ['$scope', function ($scope)
{
$scope.names = ['Igor', 'Misko', …Run Code Online (Sandbox Code Playgroud) 我有一个源帐户和目标帐户之间的帐户连接列表,因此我的架构看起来像
var ConnectionRequestSchema = new Schema({
sourceAccountId: {
type: Schema.ObjectId,
ref: 'Account'
},
targetAccountId: {
type: Schema.ObjectId,
ref: 'Account'
},
status: {
type: String,
enum: ['pending', 'accept', 'decline'],
trim: true
}
});
Run Code Online (Sandbox Code Playgroud)
我想查询sourceAccountId或targetAccountId等于查询到的accountId的所有文档。
我看到此链接如何找到一个文档,其中一个或另一个字段匹配一个值,该值与在Mongo中使用Stand find方法查找文档有关。
User.findOne({
$or: [
{first_name: name},
{last_name: name},
],
}, function(err, user) {
})
Run Code Online (Sandbox Code Playgroud)
但是我想使用Mongoose Middleware做到这一点,我不确定如何构造这种条件。
如何使用 Postgresql 数据库解决 Docker Volume 中的磁盘已满错误。
我不确定问题是否出在 docker、docker 卷或 Postgres 配置上。
环境
MAC 上的 Docker - Postgresql
运行 Rails 应用程序时出现以下错误。
PG::DiskFull: 错误: 无法写入文件“base/pgsql_tmp/pgsql_tmp125.6.sharedfileset/i35of64.p0.0”: 设备上没有剩余空间
导入数据库转储时我也遇到这些类型的问题
错误:无法扩展文件“base/1051062/1259”:设备上没有剩余空间
提示:检查可用磁盘空间。
语句:使用 btree (xyz_id, abc_key) WHERE ((NOT前景) AND (abc_key IS NOT NULL)); 在 public.some_table 上创建索引index_some_table_key
容器壳盘尺寸
docker exec -it pg13 bash
root@51fe1c96f701:/# df -h
Filesystem Size Used Avail Use% Mounted on
overlay 59G 56G 26M 100% /
tmpfs 64M 0 64M 0% /dev
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
shm 64M 1.3M 63M 2% …Run Code Online (Sandbox Code Playgroud) postgresql ruby-on-rails docker docker-compose docker-volume
angular ×2
angularjs ×2
javascript ×2
mongodb ×2
mongoose ×2
ajax ×1
asp.net ×1
asp.net-mvc ×1
azure ×1
bootstrap-4 ×1
c# ×1
docker ×1
enums ×1
epplus ×1
excel ×1
express ×1
mocha.js ×1
ng-bootstrap ×1
node.js ×1
postgresql ×1
should.js ×1
supertest ×1
typescript ×1
validation ×1
webpack-2 ×1